[odb-users] Temp Ids

Erez Pics picserez at gmail.com
Thu Dec 11 17:19:06 EST 2014


 Hi Boris,

Thank you very much for your help, we managed to find our concurrency
problem and things seems to work good now :-)

Our software needs to assign temp Ids to objects, the objects need to
behave exactly like regular permanent ones in terms of save\load\query
etc'

At some point the objects are either given a permanent ID or deleted.

I thought of using a different segment for temp objects, for example:
* Permanent objects identifiers will be positive from 1 and on (1,2,3,4....)
* Temp objects identifiers will be negative from -1000 and on
(-1000,-1001,-1002,-1003...)
* The code is issuing valid consecutive positive or negative
identifiers, I am not using SQLite auto numbering for these tables.

I would be happy to hear if you find a problem in using negative identifiers:
1) Is there a problem using negative and positive identifiers together
with SQLite and ODB ?
2) Assuming it's legal, and we decide to update a temp identifier to
permanent, ON UPDATE CASCADE is enough to automatically update all
dependent FKs ?

Thank you very VERY much,
Erez.



More information about the odb-users mailing list