[ZODB-Dev] Commit or lock object accross transactions
Toby Dickenson
tdickenson at geminidataloggers.com
Wed Jul 16 18:33:02 EDT 2003
On Wednesday 16 July 2003 17:17, Jeremy Hylton wrote:
> If you want to increment the object counter, you need to do it in a
> separate transaction. You'd need to use a separate database connection
> for the object id counter.
There may be an easier way to achieve what you want. If you only need a
counter, then conflict resolution may help. If you need a unique id, a random
one may ok.
If you only need a small number of unique ids then there may be a cheeky
option..... the method for allocating ZODB OIDs has all of the
characteristics that you need. You could use an oid of a newly created object
as your unique id, or call the storage.new_oid method directly.
--
Toby Dickenson
http://www.geminidataloggers.com/people/tdickenson
More information about the ZODB-Dev
mailing list