[odb-users] Unable to load objects after application restart

Boris Kolpackov boris at codesynthesis.com
Fri May 18 10:45:26 EDT 2012


Khaldon,

In the future please use more descriptive subject lines instead of
just "Help" as discussed in the posting guidelines:

http://www.codesynthesis.com/support/posting-guidelines.xhtml

khaldon hmesheh <khaldon_hmesheh at yahoo.com> writes:

> I have generated an sqlite database file and I have written something
> in it, but after I restart my application to do some changes later I
> can't access my persistent objects within it. It always tells me that
> no objects when I try to query for them.

If you are using database.hxx from one of the examples (and I believe
you are), then this code by default re-creates the database schema
(and deletes all its contents) every time you call create_schema().
See the block of code that starts with the "// Create the database
schema..." comment after "#elif defined(DATABASE_SQLITE)".

The schema/embedded example in the odb-examples package includes a
piece of code that shows how to create the schema only if it doesn't
already exist.

Boris



More information about the odb-users mailing list