|
int test(int argc, char** argv)
{
c4_Storage storage("test1.db", true);
c4_View v = storage.GetAs("test[col1:I,col2:I]");
int oldNumProperties = v.NumProperties();
v = storage.GetAs("test[col1:I]");
//storage.Commit();
int newNumProperties = v.NumProperties();
// will fail unless the storage.Commit() line is uncommented
assert(newNumProperties == oldNumProperties - 1);
return 0;
} |
|
This is correct behavior... GetAs changes properties to have a "temporary" status.
These stay around, and so does their contents, until the next commit. This can
be used to convert properties, for example.
Likewise, properties can be "added" to views during use. These too stay around
until the next commit or rollback. This in turn is useful to track cached non-persistent
details.
I understand that this way of dealing with things may be a bit surprising. |