ptr<C> id sometimes not as a long long variable
Added by nourieh sadat zabetzadeh over 2 years ago
when i add a record in DB and get the output, after commit the transaction, i get the id of output's ptr<>. If this ID is small, the value of id is true. but if it is large, the value become negative.
Meanwhile, if i query to DB and get that id, the value is true and in long long format. Although in both senario, the type of id define as long long. I think this is a bug, but if have a solution please say me.
my code:
Db_object * object = new Db_object()
object->name = name
.
.
.
ptr = session->add(object)
Replies (1)
RE: ptr<C> id sometimes not as a long long variable - Added by nourieh sadat zabetzadeh over 2 years ago
nourieh sadat zabetzadeh wrote:
in bellow code
Db_object * obj = new Db_object()
obj->name = name
.
.
.
ptr ptr_out_put = session->add(obj)when i add a record (obj) to DB and get the output (ptr_out_put), after commit the transaction, i get the id of ptr_out_put ptr. If this ID is small, the value of id is true. but if it is large, the value become negative.
Meanwhile, if i query to DB and get that id, the value is true and in long long format. Although in both senario, the type of id define as long long. I think this is a bug, but if have a solution please say me.my code: