On Sun, 11 Dec 2005 08:30:06 -0500 [EMAIL PROTECTED] wrote. > On Dec 11, 2005, at 4:23 AM, Tadashi Matsumoto wrote: > > > Hello > > > > I was looking into the following code of intid's __init__.py. > ... > > > > I think it is better to use, for example, 2**30 instead of 2**31. > > Looks like a good catch to me. > > Also looks like 2**31 -1 would be sufficient (typical sys.maxint),
No it wouldn't, because intid will increase. > rather than 2**30...or maybe just sys.maxint (though I wouldn't be > surprised if the author had consciously rejected maxint for database > portability). > > > By the way, there is a probability (less than 1/2**31 percent) of > > generating same intids, if thread switching occurs between the line > > 114 and 115. > > At which point you should get a conflict error, which in Zope would > cause one of the transactions to be retried without the user's > knowledge and everything would still be good. > > Gary Generating same intids does not always mean a conflict error. ---- Tadashi Matsumoto [EMAIL PROTECTED] _______________________________________________ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com