[odb-users] callback is not being called

Doug Tomm dctomm at gmail.com
Thu Oct 4 17:20:25 EDT 2012


ODB version:  2.0.0
compiler:  gcc 4.1.2
OS:  CentOS 5

hello,

i have defined a class with a persist callback, but that callback is not being called, for any event.  everything works -- when i persist the object instance, it appears in the database.  but except that the callback is never invoked.  how do i make this work?

here are snippets from my code:

#pragma db object table("account") callback(oninsert)
class Account
{
private:
  void oninsert(::odb::callback_event event, ::odb::database& db)
  {
    std::cout << "whee" << std::endl;
	// other goings-on here
  }

the only place in the generated code where i see my callback is in the .ixx file:

  inline
  void access::object_traits< Account >::
  callback (database& db, object_type& x, callback_event e)
  {
    ODB_POTENTIALLY_UNUSED (db);
    ODB_POTENTIALLY_UNUSED (x);
    ODB_POTENTIALLY_UNUSED (e);

    static_cast< Account& > (x).oninsert (e, db);
  }


many thanks,
doug



More information about the odb-users mailing list