[odb-users] Completing Transactions in the callback function of a persistent class

Sum, Eric B eric.b.sum at lmco.com
Thu Aug 18 18:16:50 EDT 2011


Hi,

I am trying to make odb an transaction for querying and then deleting the result of that query on the post-persist event of the callback function of a persistent class.  To do this, I need to include the proper header files such as odb/database.hxx and odb/transaction.hxx.  However, when I include these files in the header file of the persistent class(where the callback function is) or in a different header file included by that persistent class's header file, I get lots of errors when I run the odb compiler on the persistent class's header file.

The errors are about not being able to find object traits and other fields for the class that I am trying to make persistent.  I am assuming that this is because I am trying to make a transaction in a persistent class.

My ultimate goal is to make this such that every time an object of this type is persisted in the database, something gets triggered to perform a query and a delete in the database.

Is there a way to declare odb transactions in the callback function of a persistent class?

Thanks,
Eric


More information about the odb-users mailing list