Best policy to assign policy to assign ids to objects inside BTreeFolder2
Hi all. I need to create a number of objects inside a BTreeFolder2 container. I would like to minimize the chances of conflicts, so I'm exploring possibilities to assign ids; up to now I've found the following: - timestamps - random numbers What is the best choice to reduce the chances of conflicts? Regards Marco -- Marco Bizzarri http://iliveinpisa.blogspot.com/
You could use the uuid package (http://pypi.python.org/pypi/uuid/1.30) cb -----Oorspronkelijk bericht----- Van: zope-bounces@zope.org [mailto:zope-bounces@zope.org] Namens Marco Bizzarri Verzonden: maandag 7 juli 2008 14:53 Aan: Zope Users Mailing List Onderwerp: [Zope] Best policy to assign policy to assign ids to objects insideBTreeFolder2 Hi all. I need to create a number of objects inside a BTreeFolder2 container. I would like to minimize the chances of conflicts, so I'm exploring possibilities to assign ids; up to now I've found the following: - timestamps - random numbers What is the best choice to reduce the chances of conflicts? Regards Marco -- Marco Bizzarri http://iliveinpisa.blogspot.com/ _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.138 / Virus Database: 270.4.5/1537 - Release Date: 6-7-2008 5:26
(Mon, Jul 07, 2008 at 02:52:57PM +0200) Marco Bizzarri wrote/schrieb/egrapse:
I need to create a number of objects inside a BTreeFolder2 container.
I would like to minimize the chances of conflicts, so I'm exploring possibilities to assign ids; up to now I've found the following:
- timestamps - random numbers
What is the best choice to reduce the chances of conflicts?
How about the API that BTreeFolder2 provides? Look for generateId(). In my experience it works quite well. It just counts integers up, but resolves conflicts. It gives you the ability to assign prefixes and suffixes. Regards, Sascha
On Wed, Jul 9, 2008 at 1:53 PM, Sascha Welter <zopelist@betabug.ch> wrote:
(Mon, Jul 07, 2008 at 02:52:57PM +0200) Marco Bizzarri wrote/schrieb/egrapse:
I need to create a number of objects inside a BTreeFolder2 container.
I would like to minimize the chances of conflicts, so I'm exploring possibilities to assign ids; up to now I've found the following:
- timestamps - random numbers
What is the best choice to reduce the chances of conflicts?
How about the API that BTreeFolder2 provides?
Look for generateId(). In my experience it works quite well. It just counts integers up, but resolves conflicts. It gives you the ability to assign prefixes and suffixes.
Regards,
Sascha
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
I was not aware of the BTreeFolder2 API. I'll take a look at it right now. Regards Marco. -- Marco Bizzarri http://iliveinpisa.blogspot.com/
participants (3)
-
Kees de Brabander -
Marco Bizzarri -
Sascha Welter