[odb-users] session_required exception when using custom session

Marcel Nehring mne at qosmotec.com
Fri Apr 1 10:53:47 EDT 2016


Hi all,

I am using a custom session implementation and in general it is working well. However, today I encountered a session_required exception when I tried to load an object loading view.
In the generated code I see that in the init method of the corresponding view_traits_impl class there is a code block like this:

    if (!session::has_current ())
      throw session_required ();

So of course this will always throw since I do not use ODBs session implementation. I did, however, provide the --session-type command line option. I also see my custom implementation being used at other occasions.

What made me think was that the ODB manual does not include a has_current method as a requirement for a custom session implementation. So even if the type was substituted with my own implementation it would not work.

Am I missing something?

Regards,
Marcel


More information about the odb-users mailing list