[odb-users] Exception : "object not persistent" when trying to load object which does not exist in database

Florent GRATTA gratta at visuol.com
Thu Nov 12 11:04:52 EST 2015


Thank's a lot. You right, no "#pragma db null" is set to the relation.

What is the difference between null/not_null and value_null/value_not_null ?

Because I tried to specified "#pragma db value_null" on std::string field
and the column was created as TEXT NOT NULL

Regards,



-----Message d'origine-----
De : Boris Kolpackov [mailto:boris at codesynthesis.com] 
Envoyé : jeudi 12 novembre 2015 16:56
À : Florent GRATTA
Cc : odb-users at codesynthesis.com
Objet : Re: [odb-users] Exception : "object not persistent" when trying to
load object which does not exist in database

Hi Florent,

Florent GRATTA <gratta at visuol.com> writes:

> I have also the "Object not persistent" exception when I try to load 
> an object that is in database but with a null value in relation column 
> (null value is allowed in db, but odn thourght the exception)

But is NULL value allowed in ODB? In other words, do you have '#pragma db
null' for the data member corresponding to the relation column? Maybe that's
what causes the exception to be thourght?

Boris




More information about the odb-users mailing list