Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: CMF

cmfuid

 

 

First page Previous page 1 2 Next page Last page  View All Zope cmf RSS feed   Index | Next | Previous | View Threaded


chrism at plope

Nov 20, 2004, 12:58 PM

Post #1 of 27 (4479 views)
Permalink
cmfuid

I had a need for "globally unique ids" and was taking a look at CMFUid
for this purpose but I decided that the expense of writing to the
database to get a unique id was too much for my particular application.

I was wondering if people had opinions on making UIDs compliant with the
IETF draft at
http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-03.txt
instead of using a database-generated serial number.

Benefits:

- No database writes necessary to generate a unique id (as long as
you have probability/entropy on your side).

- Well-understood format due to spec.

Downsides:

- Need to be careful to have a viable source of entropy on the system
you're generating UUIDs on if you want to use "Version 4" UUIDs
(128-bit completely random numbers).

Thoughts?

- C


_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


jens at dataflake

Nov 20, 2004, 1:30 PM

Post #2 of 27 (4415 views)
Permalink
Re: cmfuid [In reply to]

> I was wondering if people had opinions on making UIDs compliant with
> the
> IETF draft at
> http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-03.txt
> instead of using a database-generated serial number.
>
> Benefits:
>
> - No database writes necessary to generate a unique id (as long as
> you have probability/entropy on your side).
>
> - Well-understood format due to spec.
>
> Downsides:
>
> - Need to be careful to have a viable source of entropy on the system
> you're generating UUIDs on if you want to use "Version 4" UUIDs
> (128-bit completely random numbers).

I like the standards-compliance, but so far haven't found a need for
UIDs or UUIDs in general.

IIRC the current implementation was meant more as a "first cut" -
Gregoire (who seems the main culprit), please correct me if I am wrong.
There was some exchange on the lists about CMFUid vs the concept of
UUIDs and I believe the outcome was that CMFUid does not claim to
generate UUIDs at all, just UIDs. I'm not sure if true UUIDs are even
in the scope of CMFUid.

jens

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


chrism at plope

Nov 20, 2004, 2:39 PM

Post #3 of 27 (4411 views)
Permalink
Re: cmfuid [In reply to]

On Sat, 2004-11-20 at 16:30, Jens Vagelpohl wrote:
> I like the standards-compliance, but so far haven't found a need for
> UIDs or UUIDs in general.

Neither had I, at least until lately.

The reason I want a uid now is to be able to have a unique hash value
for objects so I can resolve that hash value to a file in a directory on
a disk. It's important (mainly for security) that no two hash values
are the same and they need to be static per-object across process
lifetimes once assigned.

I could use the object's physical path for this purpose or some other
attribute with business meaning, but for performance reasons, it's very
undesirable to need to "fix up" the disk files when these (invariably)
change.

> IIRC the current implementation was meant more as a "first cut" -
> Gregoire (who seems the main culprit), please correct me if I am wrong.
> There was some exchange on the lists about CMFUid vs the concept of
> UUIDs and I believe the outcome was that CMFUid does not claim to
> generate UUIDs at all, just UIDs. I'm not sure if true UUIDs are even
> in the scope of CMFUid.

I'm not sure there's much of a difference in cases like mine. UUIDs
happen to claim to be "globally unique" but I really don't care whether
they are or not for my particular use; I just want them to be unique to
this Zope instance. Any strategy that gets rid of the database write is
cool with me.

FWIW, the current implementation of CMFUid depends entirely on conflicts
to assure that no two threads get the same uid at the same instant.
This is broken, at least under 2.7 (no MVCC) inasmuch as it depends on
BTrees.Length, which ignores read conflicts by design. The current
implementation *will* dole out the same UID to two simultaneous
callers. Subclassing Length is possible to make it respect read
conflicts and thus generate unique ids, but this will be a
performance-eating hotspot under 2.7 and perhaps under 2.8 depending on
how efficient MVCC is.

- C


_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


tseaver at zope

Nov 20, 2004, 8:41 PM

Post #4 of 27 (4377 views)
Permalink
Re: cmfuid [In reply to]

Chris McDonough wrote:
> On Sat, 2004-11-20 at 16:30, Jens Vagelpohl wrote:
>
>>I like the standards-compliance, but so far haven't found a need for
>>UIDs or UUIDs in general.
>
>
> Neither had I, at least until lately.
>
> The reason I want a uid now is to be able to have a unique hash value
> for objects so I can resolve that hash value to a file in a directory on
> a disk. It's important (mainly for security) that no two hash values
> are the same and they need to be static per-object across process
> lifetimes once assigned.
>
> I could use the object's physical path for this purpose or some other
> attribute with business meaning, but for performance reasons, it's very
> undesirable to need to "fix up" the disk files when these (invariably)
> change.

You don't need to, if you store the hash key used to locate the file on
the object itself. You should then plan to index them, in order to
traverse back from the file to the ZODB object. ;)

BTW, the performance hit of moving an inode from one directory to
another within the same filesystem is inconsequential when compared to
the other costs you are going to incur when you move placeful content.

>>IIRC the current implementation was meant more as a "first cut" -
>>Gregoire (who seems the main culprit), please correct me if I am wrong.
>>There was some exchange on the lists about CMFUid vs the concept of
>>UUIDs and I believe the outcome was that CMFUid does not claim to
>>generate UUIDs at all, just UIDs. I'm not sure if true UUIDs are even
>>in the scope of CMFUid.
>
>
> I'm not sure there's much of a difference in cases like mine. UUIDs
> happen to claim to be "globally unique" but I really don't care whether
> they are or not for my particular use; I just want them to be unique to
> this Zope instance. Any strategy that gets rid of the database write is
> cool with me.

You are worried about adding a single entry in a btree-bucket when
creating all the other crap associated with a new content object in the
ZODB? Really?

> FWIW, the current implementation of CMFUid depends entirely on conflicts
> to assure that no two threads get the same uid at the same instant.
> This is broken, at least under 2.7 (no MVCC) inasmuch as it depends on
> BTrees.Length, which ignores read conflicts by design. The current
> implementation *will* dole out the same UID to two simultaneous
> callers. Subclassing Length is possible to make it respect read
> conflicts and thus generate unique ids, but this will be a
> performance-eating hotspot under 2.7 and perhaps under 2.8 depending on
> how efficient MVCC is.

That is a different problem. The approach should probably do something
like the RID-generation stuff in the catalog, which doesn't rely on
write conflicts to avoid collisions.

I don't think you want a purely probabilistic / heuristic solution, but
I could be wrong (feel free to ding me for a beer, if so).

Tres.
--
===============================================================
Tres Seaver tseaver [at] zope
Zope Corporation "Zope Dealers" http://www.zope.com
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


tseaver at zope

Nov 20, 2004, 8:41 PM

Post #5 of 27 (4416 views)
Permalink
Re: cmfuid [In reply to]

Chris McDonough wrote:
> On Sat, 2004-11-20 at 16:30, Jens Vagelpohl wrote:
>
>>I like the standards-compliance, but so far haven't found a need for
>>UIDs or UUIDs in general.
>
>
> Neither had I, at least until lately.
>
> The reason I want a uid now is to be able to have a unique hash value
> for objects so I can resolve that hash value to a file in a directory on
> a disk. It's important (mainly for security) that no two hash values
> are the same and they need to be static per-object across process
> lifetimes once assigned.
>
> I could use the object's physical path for this purpose or some other
> attribute with business meaning, but for performance reasons, it's very
> undesirable to need to "fix up" the disk files when these (invariably)
> change.

You don't need to, if you store the hash key used to locate the file on
the object itself. You should then plan to index them, in order to
traverse back from the file to the ZODB object. ;)

BTW, the performance hit of moving an inode from one directory to
another within the same filesystem is inconsequential when compared to
the other costs you are going to incur when you move placeful content.

>>IIRC the current implementation was meant more as a "first cut" -
>>Gregoire (who seems the main culprit), please correct me if I am wrong.
>>There was some exchange on the lists about CMFUid vs the concept of
>>UUIDs and I believe the outcome was that CMFUid does not claim to
>>generate UUIDs at all, just UIDs. I'm not sure if true UUIDs are even
>>in the scope of CMFUid.
>
>
> I'm not sure there's much of a difference in cases like mine. UUIDs
> happen to claim to be "globally unique" but I really don't care whether
> they are or not for my particular use; I just want them to be unique to
> this Zope instance. Any strategy that gets rid of the database write is
> cool with me.

You are worried about adding a single entry in a btree-bucket when
creating all the other crap associated with a new content object in the
ZODB? Really?

> FWIW, the current implementation of CMFUid depends entirely on conflicts
> to assure that no two threads get the same uid at the same instant.
> This is broken, at least under 2.7 (no MVCC) inasmuch as it depends on
> BTrees.Length, which ignores read conflicts by design. The current
> implementation *will* dole out the same UID to two simultaneous
> callers. Subclassing Length is possible to make it respect read
> conflicts and thus generate unique ids, but this will be a
> performance-eating hotspot under 2.7 and perhaps under 2.8 depending on
> how efficient MVCC is.

That is a different problem. The approach should probably do something
like the RID-generation stuff in the catalog, which doesn't rely on
write conflicts to avoid collisions.

I don't think you want a purely probabilistic / heuristic solution, but
I could be wrong (feel free to ding me for a beer, if so).

Tres.
--
===============================================================
Tres Seaver tseaver [at] zope
Zope Corporation "Zope Dealers" http://www.zope.com

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


tseaver at zope

Nov 20, 2004, 8:44 PM

Post #6 of 27 (4428 views)
Permalink
Re: cmfuid [In reply to]

Jens Vagelpohl wrote:
>> I was wondering if people had opinions on making UIDs compliant with the
>> IETF draft at
>> http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-03.txt
>> instead of using a database-generated serial number.
>>
>> Benefits:
>>
>> - No database writes necessary to generate a unique id (as long as
>> you have probability/entropy on your side).
>>
>> - Well-understood format due to spec.
>>
>> Downsides:
>>
>> - Need to be careful to have a viable source of entropy on the system
>> you're generating UUIDs on if you want to use "Version 4" UUIDs
>> (128-bit completely random numbers).
>
>
> I like the standards-compliance, but so far haven't found a need for
> UIDs or UUIDs in general.
>
> IIRC the current implementation was meant more as a "first cut" -
> Gregoire (who seems the main culprit), please correct me if I am wrong.
> There was some exchange on the lists about CMFUid vs the concept of
> UUIDs and I believe the outcome was that CMFUid does not claim to
> generate UUIDs at all, just UIDs. I'm not sure if true UUIDs are even in
> the scope of CMFUid.

UUIDs have disadvantages: they can't be used to synthesize *anything*
useful to humans (how many of you have ever had to grub through the
Windows registry, trying to find the component which is hosing your
system?).

The CMFUID tool defines an interface, but leaves the UID as "opaque"
tokens. Thus, it allows folks who (believe that they) need UUIDs to
supply a UID generation tool which generates them, without requiring
that folks who *don't* need them pay the (conceptual or computational) cost.

BTW, based on feedback in Vienna, I expect the Plone developers will
release a UUID-generating replacement tool in the not-too-distant future.

Tres.
--
===============================================================
Tres Seaver tseaver [at] zope
Zope Corporation "Zope Dealers" http://www.zope.com

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


chrism at plope

Nov 20, 2004, 10:05 PM

Post #7 of 27 (4432 views)
Permalink
Re: cmfuid [In reply to]

On Sat, 2004-11-20 at 23:41 -0500, Tres Seaver wrote:
> > I could use the object's physical path for this purpose or some other
> > attribute with business meaning, but for performance reasons, it's very
> > undesirable to need to "fix up" the disk files when these (invariably)
> > change.
>
> You don't need to, if you store the hash key used to locate the file on
> the object itself.

Yup, that's what I'm doing.

> You should then plan to index them, in order to
> traverse back from the file to the ZODB object. ;)

I hope I never have to do that.

> BTW, the performance hit of moving an inode from one directory to
> another within the same filesystem is inconsequential when compared to
> the other costs you are going to incur when you move placeful content.

You're right, sorry, it's not a performance thing. It's a "I just don't
want to write that code" thing. I'm trying to tie the writing of files
to transactions and it seems hard enough as it is without needing to
pseudo-transactionally move stuff too. Although maybe that'd be simpler
in the end, I don't know.

> > I'm not sure there's much of a difference in cases like mine. UUIDs
> > happen to claim to be "globally unique" but I really don't care whether
> > they are or not for my particular use; I just want them to be unique to
> > this Zope instance. Any strategy that gets rid of the database write is
> > cool with me.
>
> You are worried about adding a single entry in a btree-bucket when
> creating all the other crap associated with a new content object in the
> ZODB? Really?

No, I'm worried about generating actual unique ids without read
conflicts causing the request to be retried. (FWIW, there are no BTrees
around in CMFUid, just a Length object.)

> > FWIW, the current implementation of CMFUid depends entirely on conflicts
> > to assure that no two threads get the same uid at the same instant.
> > This is broken, at least under 2.7 (no MVCC) inasmuch as it depends on
> > BTrees.Length, which ignores read conflicts by design. The current
> > implementation *will* dole out the same UID to two simultaneous
> > callers. Subclassing Length is possible to make it respect read
> > conflicts and thus generate unique ids, but this will be a
> > performance-eating hotspot under 2.7 and perhaps under 2.8 depending on
> > how efficient MVCC is.
>
> That is a different problem. The approach should probably do something
> like the RID-generation stuff in the catalog, which doesn't rely on
> write conflicts to avoid collisions.

Yup it is a different problem.

> I don't think you want a purely probabilistic / heuristic solution, but
> I could be wrong (feel free to ding me for a beer, if so).

No, you're right, I don't care one way or another, but assuming I do
want unique ids, I'd like to get them without putting up with retried
requests.

I took a look at the rid generator and it scares me that I understand
it. Out of curiosity, what is the main argument against probabilistic
uid generation? It seems so much simpler. Is that one of those
water-in-the-desert kind of mirages?

Thanks!

- C


_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


chrism at plope

Nov 20, 2004, 10:34 PM

Post #8 of 27 (4419 views)
Permalink
Re: Re: cmfuid [In reply to]

On Sat, 2004-11-20 at 23:44 -0500, Tres Seaver wrote:
> UUIDs have disadvantages: they can't be used to synthesize *anything*
> useful to humans (how many of you have ever had to grub through the
> Windows registry, trying to find the component which is hosing your
> system?).

This might be obvious but I think the problem with non-opaque ids is
that you *can* synthesize information from is them. They have business
meaning, which means they need to be changed from time to time
(sometimes for no reason other than aesthetics, e.g. "Mary Wilson got
married and is now Mary Jones, change her username to mjones"). Having
something completely inscrutable as as an identifier introduces its own
set of problems (Windows registry hunting) but removes the natural human
temptation to want to make sense out of an id by itself.

As far as I can tell this is true whether an opaque id is meant to be a
UUID or just a UID, so I don't think it's a failing of UUIDs alone.

Personally, I probably wouldn't want a unique id generator that
generated its id based on, for example, the title of an object. I've
done this before, but the title changes, at which point the id becomes
misleading, which completely confuses the heck out of me and leads me to
wonder why I didn't use opaque ids in the first place.


- C


_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


gregweb at gmx

Nov 21, 2004, 11:08 AM

Post #9 of 27 (4426 views)
Permalink
Re: Re: cmfuid [In reply to]

Hi Chris,

>No, I'm worried about generating actual unique ids without read
>conflicts causing the request to be retried. (FWIW, there are no BTrees
>around in CMFUid, just a Length object.)
>
>> That is a different problem. The approach should probably do something
>> like the RID-generation stuff in the catalog, which doesn't rely on
>> write conflicts to avoid collisions.
>
>Yup it is a different problem.

When I did that it seemed to me to be the simplest method to use a counter.
Using BTrees.Length was then the best decission. BTrees.Length do write
conflict management.

As I'm not so deep into ZODB I can't say anything about read conflicts.

My advice is to just replace 'portal_uidgenerator' with your own UID
or UUID generator implementation.

By the way: It would be cool if someone could implement <http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-03.txt> (hint, hint!). Actually I think this should be a python lib ...

Gregoire

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


gregweb at gmx

Nov 21, 2004, 11:15 AM

Post #10 of 27 (4404 views)
Permalink
Re: cmfuid [In reply to]

Hi Jens,

Sorry for beeing late in the discussion ...

>IIRC the current implementation was meant more as a "first cut" - Gregoire (who seems the main culprit), please correct me if I am wrong.

Yes. I am the culprit ...

>There was some exchange on the lists about CMFUid vs the concept of UUIDs and I believe the outcome was that CMFUid does not claim to generate UUIDs at all, just UIDs. I'm not sure if true UUIDs are even in the scope of CMFUid.

The main scope was to build a basic architecture with a default implementation.
Every tool may be replaced by a own implementation.

Gregoire

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


chrism at plope

Nov 21, 2004, 6:19 PM

Post #11 of 27 (4431 views)
Permalink
Re: Re: cmfuid [In reply to]

On Sun, 2004-11-21 at 14:08, Gregoire Weber wrote:
> When I did that it seemed to me to be the simplest method to use a counter.

Yes, the simpler the better... the simplicity of the tool is very good
now.

> Using BTrees.Length was then the best decission. BTrees.Length do write
> conflict management.

Yes.

> As I'm not so deep into ZODB I can't say anything about read conflicts.

Read conflicts were added late in ZODB's history after someone noticed
that if you read data from an object that had been invalidated in one
transaction and wrote that data into another object in the course of
another transaction, data inconsistencies could occur. Read conflicts
cannot be resolved unless you're using MVCC, which is only present in
ZODB 3.3 (Zope 2.8 and 3). MVCC's primary job is to prevent read
conflicts.

> My advice is to just replace 'portal_uidgenerator' with your own UID
> or UUID generator implementation.

We should probably fix the default one because it doesn't guarantee
uniqueness of ids. The simplest fix would be to not use a Length object
as the counter but to use a subclass of Length that returned false from
its _p_independent method. This would probably work for most people,
although probably not very well for applications that generated lots of
uids simultaneously.

> By the way: It would be cool if someone could implement <http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-03.txt> (hint, hint!). Actually I think this should be a python lib ...

I have the beginnings of such a thing at
http://www.plope.com/software/uuidgen/view . Not really, because it
doesn't follow the string formatting rules of the spec and it only does
"Version 4" UUIDs (without a version bit set) but I guess it's a start.

- C



_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


jens at dataflake

Nov 22, 2004, 1:00 AM

Post #12 of 27 (4405 views)
Permalink
Re: Re: cmfuid [In reply to]

>> By the way: It would be cool if someone could implement
>> <http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-03.txt>
>> (hint, hint!). Actually I think this should be a python lib ...
>
> I have the beginnings of such a thing at
> http://www.plope.com/software/uuidgen/view . Not really, because it
> doesn't follow the string formatting rules of the spec and it only does
> "Version 4" UUIDs (without a version bit set) but I guess it's a start.

Would it be unreasonable to move the UUID-generating bit into CMFUid
and replace the simple counter with it?

jens

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


tseaver at zope

Nov 22, 2004, 5:05 AM

Post #13 of 27 (4426 views)
Permalink
Re: cmfuid [In reply to]

Jens Vagelpohl wrote:
>>> By the way: It would be cool if someone could implement
>>> <http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-03.txt>
>>> (hint, hint!). Actually I think this should be a python lib ...
>>
>>
>> I have the beginnings of such a thing at
>> http://www.plope.com/software/uuidgen/view . Not really, because it
>> doesn't follow the string formatting rules of the spec and it only does
>> "Version 4" UUIDs (without a version bit set) but I guess it's a start.
>
>
> Would it be unreasonable to move the UUID-generating bit into CMFUid and
> replace the simple counter with it?

Only if it is an option, and not the default. People have real use
cases for the UIDs for which the UUID mangling is unwanted conceptual
overhead (e.g., permalinks).

Tres.
--
===============================================================
Tres Seaver tseaver [at] zope
Zope Corporation "Zope Dealers" http://www.zope.com

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


gregweb at gmx

Nov 22, 2004, 8:31 AM

Post #14 of 27 (4418 views)
Permalink
Re: Re: cmfuid [In reply to]

Hi Chris,

>> As I'm not so deep into ZODB I can't say anything about read conflicts.
>
>Read conflicts were added late in ZODB's history after someone noticed
>that if you read data from an object that had been invalidated in one
>transaction and wrote that data into another object in the course of
>another transaction, data inconsistencies could occur. Read conflicts
>cannot be resolved unless you're using MVCC, which is only present in
>ZODB 3.3 (Zope 2.8 and 3). MVCC's primary job is to prevent read
>conflicts.
>
>> My advice is to just replace 'portal_uidgenerator' with your own UID
>> or UUID generator implementation.
>
>We should probably fix the default one because it doesn't guarantee
>uniqueness of ids. The simplest fix would be to not use a Length object
>as the counter but to use a subclass of Length that returned false from
>its _p_independent method. This would probably work for most people,
>although probably not very well for applications that generated lots of
>uids simultaneously.

Ok, I understand the issue in general. But in this case BTree-Length does
a read of 'value' and tries to write to the same 'value' attribute after
having incremented it. No other variables are used to calculate the result
than 'value'. So shouldn't read conflicts be tracked by the write conflicts
anyway?

I'm not the ZODB expert here, so I probably miss some point. Based on
my deep experience in C based real time system software I don't see a
problem.

Reading the comment of '_p_independent', I see there may be a problem,
but I don't understand it really.

May you explain or somebody different? E.g. Tres?

If there is a real problem I would appreciate we correct the issue/bug.


>> By the way: It would be cool if someone could implement <http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-03.txt> (hint, hint!). Actually I think this should be a python lib ...
>
>I have the beginnings of such a thing at
>http://www.plope.com/software/uuidgen/view . Not really, because it
>doesn't follow the string formatting rules of the spec and it only does
>"Version 4" UUIDs (without a version bit set) but I guess it's a start.

Does ist work also under Win32?

I would propose here (after having corrected the counter issue) to add
a new generator tool which users can use to replace the standard one.

Gregoire

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


dieter at handshake

Nov 22, 2004, 11:26 AM

Post #15 of 27 (4424 views)
Permalink
Re: Re: cmfuid [In reply to]

Gregoire Weber wrote at 2004-11-22 17:31 +0100:
> ...
>Ok, I understand the issue in general. But in this case BTree-Length does
>a read of 'value' and tries to write to the same 'value' attribute after
>having incremented it. No other variables are used to calculate the result
>than 'value'. So shouldn't read conflicts be tracked by the write conflicts
>anyway?

Contrary to apparently general expectation, the problem lies *not*
with the (suppressed) "ReadConflictError"s but with the suppressed
"[Write]ConflictError"s.

"BTrees.Length" objects do not raise "ConflictError"s.
They have a so called application specific conflict resolution
that can combine the effect of any two conflicting transactions.

That is why a "CMFUid" implementation based on "BTrees.Length"
does not garantee id uniqueness.

Suppose transactions T1 and T2 concurrently request an id.
Suppose, the "BTrees.Length" object has value "id0".

Then both T1 and T2 will get "id0" as id value and
increment the length by "1". The conflict resolution
will prevent a "ConflictError" by incrementing the "Length" object
by 2. Thus, "id0" is used twice and "id0 + 1" is not used at all.

--
Dieter
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


chrism at plope

Nov 22, 2004, 11:45 AM

Post #16 of 27 (4435 views)
Permalink
Re: Re: cmfuid [In reply to]

On Mon, 2004-11-22 at 11:31, Gregoire Weber wrote:
> Hi Chris,
>
> >> My advice is to just replace 'portal_uidgenerator' with your own UID
> >> or UUID generator implementation.
> >
> >We should probably fix the default one because it doesn't guarantee
> >uniqueness of ids. The simplest fix would be to not use a Length object
> >as the counter but to use a subclass of Length that returned false from
> >its _p_independent method. This would probably work for most people,
> >although probably not very well for applications that generated lots of
> >uids simultaneously.
>
> Ok, I understand the issue in general. But in this case BTree-Length does
> a read of 'value' and tries to write to the same 'value' attribute after
> having incremented it. No other variables are used to calculate the result
> than 'value'. So shouldn't read conflicts be tracked by the write conflicts
> anyway?

Here's what happens in the pathological case (broken down by "time
units):

time 0: counter is at 0

time 1: thread 1 changes the counter during a new uid call,
the generated uid is 1

time 1: thread 2 changes the counter during a new uid call
the generated uid is 1

(note that no conflicts have happened yet, write conflicts are only
raised at commit time and read conflicts don't happen because the Length
object is _p_independent)

time 2: thread 1 commits

time 3: thread 2 commits, but commit generates a write conflict
due to thread 1 being generated beforehand. The write
conflict for the counter is resolved and it is set to 2.

Note that the counter is indeed correct (it's now 2, the next uid handed
out will be 3) but we've handed out the uid "1" twice. We resolved the
write conflict on the Length object at commit time but it didn't help
us. Both threads committed after giving two different callers the same
uid, so we presumably now have two objects with the same "uid" value,
which is not desirable.

Making _p_independent of the Length object return false will cause a
read conflict to be generated at the time of uid generation (during
"change") if two threads ask for a uid simultaneously. This has the
effect at least under Zope 2.7 of causing actually unique ids to be
generated. This doesn't work under 2.8. Under 2.8, MVCC begins to kick
in and we have the same problem again even if we override
_p_independent.

The very simplest thing to do here is to just use a plain integer
counter rather than a Length object, FWIW. It's the only simple
solution that works for 2.7 and 2.8, probably at significant expense due
to retries. Less simple strategies exist to generate uids using the
database, like the strategy used by the catalog to generate "rids" that
do guarantee uniqueness, but the code becomes much less aesthetically
pleasing.

> I'm not the ZODB expert here, so I probably miss some point. Based on
> my deep experience in C based real time system software I don't see a
> problem.
>
> Reading the comment of '_p_independent', I see there may be a problem,
> but I don't understand it really.
>
> May you explain or somebody different? E.g. Tres?
>
> If there is a real problem I would appreciate we correct the issue/bug.

I think it is a real problem, but I'm not sure of the best way to fix
it. I'd just use a probabilistic generator but Tres doesn't like them,
I think. I don't yet understand why, but I'm sure there's a good reason
(Tres is right about 99.3% of the time ;-).

> >> By the way: It would be cool if someone could implement <http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-03.txt> (hint, hint!). Actually I think this should be a python lib ...
> >
> >I have the beginnings of such a thing at
> >http://www.plope.com/software/uuidgen/view . Not really, because it
> >doesn't follow the string formatting rules of the spec and it only does
> >"Version 4" UUIDs (without a version bit set) but I guess it's a start.
>
> Does ist work also under Win32?

No, although presumably it would be pretty simple to make it do so, I'd
just steal the code from Python 2.4.

> I would propose here (after having corrected the counter issue) to add
> a new generator tool which users can use to replace the standard one.

I'm not sure we need two default id generators, but I'll do whatever
anybody wants done.

- C


_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


gregweb at gmx

Nov 23, 2004, 9:33 AM

Post #17 of 27 (4418 views)
Permalink
Re: Re: cmfuid [In reply to]

Hi Chris,


>Here's what happens in the pathological case (broken down by "time
>units):
>
>time 0: counter is at 0
>
>time 1: thread 1 changes the counter during a new uid call,
> the generated uid is 1
>
>time 1: thread 2 changes the counter during a new uid call
> the generated uid is 1
>
>(note that no conflicts have happened yet, write conflicts are only
>raised at commit time and read conflicts don't happen because the Length
>object is _p_independent)
>
>time 2: thread 1 commits
>
>time 3: thread 2 commits, but commit generates a write conflict
> due to thread 1 being generated beforehand. The write
> conflict for the counter is resolved and it is set to 2.
>
>Note that the counter is indeed correct (it's now 2, the next uid handed
>out will be 3) but we've handed out the uid "1" twice. We resolved the
>write conflict on the Length object at commit time but it didn't help
>us. Both threads committed after giving two different callers the same
>uid, so we presumably now have two objects with the same "uid" value,
>which is not desirable.

Oh dear, now I see it!

I hoped the BTree.Length would manage everything for us ... (but I know by
experience that when you think like this the alarm bell shall bell).

So the fast solution for now is to have a hot spot (counter) ...


>Making _p_independent of the Length object return false will cause a
>read conflict to be generated at the time of uid generation (during
>"change") if two threads ask for a uid simultaneously. This has the
>effect at least under Zope 2.7 of causing actually unique ids to be
>generated. This doesn't work under 2.8. Under 2.8, MVCC begins to kick
>in and we have the same problem again even if we override
>_p_independent.

I have to think more about that later (when I have more time).
But am I right that the current solution would be ok for Zope 2.8 with
MVCC?

Anyway, before the whole MVCC discussion arised I thought the
ZODB is already MVCC capable.

>I think it is a real problem, but I'm not sure of the best way to fix
>it. I'd just use a probabilistic generator but Tres doesn't like them,
>I think. I don't yet understand why, but I'm sure there's a good reason
>(Tres is right about 99.3% of the time ;-).

Hehe!


>No, although presumably it would be pretty simple to make it do so, I'd
>just steal the code from Python 2.4.

There will be a UUID implementation in Python 2.4?


>> I would propose here (after having corrected the counter issue) to add
>> a new generator tool which users can use to replace the standard one.
>
>I'm not sure we need two default id generators, but I'll do whatever
>anybody wants done.

Just an idea:

A possible solution may be to have uids and uuids in parallel. Just
appending every new uuid to a registry (IOBTree) and then take the index
as a "counter uid" (for Tres and me).

May we run into problems with conflict errors this way?

Gregoire

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


dieter at handshake

Nov 23, 2004, 1:09 PM

Post #18 of 27 (4377 views)
Permalink
Re: Re: cmfuid [In reply to]

Gregoire Weber wrote at 2004-11-23 18:33 +0100:
> ...
>>Making _p_independent of the Length object return false will cause a
>>read conflict to be generated at the time of uid generation (during
>>"change") if two threads ask for a uid simultaneously.

You cannot trust this: Assume T1 and T2 access the Length
object at the same time, then they both will read the same value --
because the invalidation is only sent when the transaction is committed!

--
Dieter
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


chrism at plope

Nov 23, 2004, 1:40 PM

Post #19 of 27 (4416 views)
Permalink
Re: Re: cmfuid [In reply to]

On Tue, 2004-11-23 at 12:33, Gregoire Weber wrote:
> Hi Chris,
>
>
> >Here's what happens in the pathological case (broken down by "time
> >units):
> >
> >time 0: counter is at 0
> >
> >time 1: thread 1 changes the counter during a new uid call,
> > the generated uid is 1
> >
> >time 1: thread 2 changes the counter during a new uid call
> > the generated uid is 1
> >
> >(note that no conflicts have happened yet, write conflicts are only
> >raised at commit time and read conflicts don't happen because the Length
> >object is _p_independent)
> >
> >time 2: thread 1 commits
> >
> >time 3: thread 2 commits, but commit generates a write conflict
> > due to thread 1 being generated beforehand. The write
> > conflict for the counter is resolved and it is set to 2.
> >
> >Note that the counter is indeed correct (it's now 2, the next uid handed
> >out will be 3) but we've handed out the uid "1" twice. We resolved the
> >write conflict on the Length object at commit time but it didn't help
> >us. Both threads committed after giving two different callers the same
> >uid, so we presumably now have two objects with the same "uid" value,
> >which is not desirable.
>
> Oh dear, now I see it!
>
> I hoped the BTree.Length would manage everything for us ... (but I know by
> experience that when you think like this the alarm bell shall bell).
>
> So the fast solution for now is to have a hot spot (counter) ...

A simple integer counter will probably work for Zope 2.7 (at great
expense for applications that have a lot of uid-generation concurrency;
it's arguable that there are many of these, however).

But the more I think about it, I realize that the simple counter will
fail to work properly under 2.8 with MVCC. I *think* it will exhibit
the above symptom for a different reason, unless there is a facility to
override what happens when read conflicts occur (and thus MVCC kicks in)
within ZODB 3.3. I don't know that there isn't such a thing, but I've
not heard of it. AFAIK, the MVCC behavior when "resolving" a read
conflict is hardwired.

> >Making _p_independent of the Length object return false will cause a
> >read conflict to be generated at the time of uid generation (during
> >"change") if two threads ask for a uid simultaneously. This has the
> >effect at least under Zope 2.7 of causing actually unique ids to be
> >generated. This doesn't work under 2.8. Under 2.8, MVCC begins to kick
> >in and we have the same problem again even if we override
> >_p_independent.
>
> I have to think more about that later (when I have more time).
> But am I right that the current solution would be ok for Zope 2.8 with
> MVCC?

The current solution does not guarantee unique ids either Zope 2.7 or
2.8+MVCC. The "plain integer counter" will likely generate unique ids
with 2.7 but not with 2.8+MVCC! :-(

> Anyway, before the whole MVCC discussion arised I thought the
> ZODB is already MVCC capable.

Only with 2.8, which includes ZODB 3.3.

> >I think it is a real problem, but I'm not sure of the best way to fix
> >it. I'd just use a probabilistic generator but Tres doesn't like them,
> >I think. I don't yet understand why, but I'm sure there's a good reason
> >(Tres is right about 99.3% of the time ;-).
>
> Hehe!
>
>
> >No, although presumably it would be pretty simple to make it do so, I'd
> >just steal the code from Python 2.4.
>
> There will be a UUID implementation in Python 2.4?

No, but there is a "urandom" module which tries hard to provide good
sources of entropy (by using /dev/urandom under UNIX and the Windows
equivalent). Creating random UUIDs from this is very easy. I'm not
sure whether there are systems "in the wild" that do not have good
entropy sources, but for those I suppose you could generate a different
type of UUID composed of time, ip address, and so forth. It's just 128
bits of *something*.

> >> I would propose here (after having corrected the counter issue) to add
> >> a new generator tool which users can use to replace the standard one.
> >
> >I'm not sure we need two default id generators, but I'll do whatever
> >anybody wants done.
>
> Just an idea:
>
> A possible solution may be to have uids and uuids in parallel. Just
> appending every new uuid to a registry (IOBTree) and then take the index
> as a "counter uid" (for Tres and me).

Maybe, I guess it depends how complex you wanted to make the tool. I
have no intrinsic love for UUIDs. I don't need or necessarily want the
default uid tool to generate UUIDs (I can subclass the tool if I want to
do this). It's fine if it just generates integer ids if that's simplest
for everybody else.

One thing that would probably work if you wanted integer uids, you were
willing to accept the expense of keeping around every uid you'd
generated in the past and you were willing to accept non-contiguous uids
is this: you could maybe use a BTrees object (IITreeSet, maybe?) as a
"uid store". When you wanted a new uid, you'd do something like this
(where self.uids is an IITreeSet):

while 1:
uid = random.randint(0, sys.maxint-1)
if self.uids.insert(uid):
return uid

You will probably run into problems due to concurrency doing the same
with contiguous serial uids (if, for example, you used "uid =
self.uids.maxKey()+1" instead of a random.randint-generated one), as it
may exhibit the same symptom as described above. It's easiest to not
use contiguous uids, AFAICT.

> May we run into problems with conflict errors this way?

Any way you go, if you use ZODB, you will get some number of conflict
errors, which is usually ok if you can minimize them. OTOH, dealing
with conflicts is hard and the best strategy is the simplest. I think
the above "IITreeSet" strategy is probably the simplest.

OTOH, calling a "uuidgen" function is simpler still and generates no
conflicts whatsoever but requires that you trust the algorithm of the
uuidgen function to actually generate probabilistically unique ids.

Some combination of the two might be in order. Shrug. ;-)

- C


_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


timh at zute

Nov 23, 2004, 3:19 PM

Post #20 of 27 (4419 views)
Permalink
Re: Re: cmfuid [In reply to]

HI Chris


> Maybe, I guess it depends how complex you wanted to make the tool. I
> have no intrinsic love for UUIDs. I don't need or necessarily want the
> default uid tool to generate UUIDs (I can subclass the tool if I want to
> do this). It's fine if it just generates integer ids if that's simplest
> for everybody else.

Something I have been trying to work out, is why the dislike for
UUID styles uid's. Also do uuid's need to be universally unique
or just unique within a site or a set of sites?

I have been using our own home grown uid tool, and uids in CMF for about 2 years
with quite a bit of success. We used the following elements to construct
the id's which where SHA based.

time + random num + path of object + client IP + server IP + instance path

Whilst it's possible that the someone else might be able to generate the same string to put
into sha, within the set of machines we run/manage it is pretty well impossible, which
is all we where worried about.

Then we only have to worry about the possibility of sha collisions, which would be pretty unlikely.

Tim




_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


chrism at plope

Nov 23, 2004, 4:52 PM

Post #21 of 27 (4429 views)
Permalink
Re: Re: cmfuid [In reply to]

On Tue, 2004-11-23 at 18:19, Tim Hoffman wrote:
> HI Chris
>
>
> > Maybe, I guess it depends how complex you wanted to make the tool. I
> > have no intrinsic love for UUIDs. I don't need or necessarily want the
> > default uid tool to generate UUIDs (I can subclass the tool if I want to
> > do this). It's fine if it just generates integer ids if that's simplest
> > for everybody else.
>
> Something I have been trying to work out, is why the dislike for
> UUID styles uid's. Also do uuid's need to be universally unique
> or just unique within a site or a set of sites?

I think the common definition of UUID is "universally unique id", where
"universe" is supposedly all systems across all time. I think this is
impossible without some centralized registry but people (namely,
Microsoft and the DAV folks who are using UUIDs in production)
apparently seem to think that relying on probability is ok for most
things.

The current CMFUid implementation does not try to generate uids with
that definition of "universe" (its "universe" is that Zope instance
only). So they are not "UUIDs".

I don't understand the resistance to UUID-format ids either. Maybe the
resistance is related to probalistic generation of uids ("Version 4"
UUIDs in the spec are meant to be generated completely randomly;
"Version 1" UUIDs use time, mac address, and so forth, which is still
probabilistic but not so much as Version 4). Or maybe it's the format
of them being 128 bits, formatted to hex, with some dashes separating
various parts of the id. Maybe both?

> I have been using our own home grown uid tool, and uids in CMF for about 2 years
> with quite a bit of success. We used the following elements to construct
> the id's which where SHA based.
>
> time + random num + path of object + client IP + server IP + instance path
>
> Whilst it's possible that the someone else might be able to generate the same string to put
> into sha, within the set of machines we run/manage it is pretty well impossible, which
> is all we where worried about.

Yup. Note that the browser id manager in Zope uses a different set of
data input but also generates "unique ids generator". These ids have
the format:

'AAAAAAAABBBBBBBB'
where:

A == leading-0-padded 8-char string-rep'd random integer
B == modified base64-encoded 11-char timestamp (precise to
clock resolution of platform)

There haven't been a rash of bug reports related to this unique id
algorithm, so I assume it's working ok at least for browser ids.

- C


_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


michael at looma

Nov 24, 2004, 1:08 AM

Post #22 of 27 (4431 views)
Permalink
Re: Re: cmfuid [In reply to]

On 24/11/2004, at 10:40, Chris McDonough wrote:

> On Tue, 2004-11-23 at 12:33, Gregoire Weber wrote:
>> Hi Chris,
>>
>>
>>> Here's what happens in the pathological case (broken down by "time
>>> units):
>>>
>>> time 0: counter is at 0
>>>
>>> time 1: thread 1 changes the counter during a new uid call,
>>> the generated uid is 1
>>>
>>> time 1: thread 2 changes the counter during a new uid call
>>> the generated uid is 1
>>>
>>> (note that no conflicts have happened yet, write conflicts are only
>>> raised at commit time and read conflicts don't happen because the
>>> Length
>>> object is _p_independent)
>>>
>>> time 2: thread 1 commits
>>>
>>> time 3: thread 2 commits, but commit generates a write conflict
>>> due to thread 1 being generated beforehand. The write
>>> conflict for the counter is resolved and it is set to 2.
>>>
>>> Note that the counter is indeed correct (it's now 2, the next uid
>>> handed
>>> out will be 3) but we've handed out the uid "1" twice. We resolved
>>> the
>>> write conflict on the Length object at commit time but it didn't help
>>> us. Both threads committed after giving two different callers the
>>> same
>>> uid, so we presumably now have two objects with the same "uid" value,
>>> which is not desirable.
>>
>> Oh dear, now I see it!
>>
>> I hoped the BTree.Length would manage everything for us ... (but I
>> know by
>> experience that when you think like this the alarm bell shall bell).
>>
>> So the fast solution for now is to have a hot spot (counter) ...
>
> A simple integer counter will probably work for Zope 2.7 (at great
> expense for applications that have a lot of uid-generation concurrency;
> it's arguable that there are many of these, however).
>
> But the more I think about it, I realize that the simple counter will
> fail to work properly under 2.8 with MVCC. I *think* it will exhibit
> the above symptom for a different reason, unless there is a facility to
> override what happens when read conflicts occur (and thus MVCC kicks
> in)
> within ZODB 3.3. I don't know that there isn't such a thing, but I've
> not heard of it. AFAIK, the MVCC behavior when "resolving" a read
> conflict is hardwired.

But a write conflict will still be raised if there is any transaction
concurrency because counter needs to be updated? So the simple counter
should work for ZODB 3.3 too.

Michael

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


dieter at handshake

Nov 24, 2004, 11:35 AM

Post #23 of 27 (4413 views)
Permalink
Re: Re: cmfuid [In reply to]

Chris McDonough wrote at 2004-11-23 16:40 -0500:
> ...
>But the more I think about it, I realize that the simple counter will
>fail to work properly under 2.8 with MVCC.

This fear is unjustified (as Michael already pointed out).

MVCC will avoid read conflicts at the cost of additional
write conflicts.

This additional write conflicts will make the UID generation
safe (unless prevented by an application specific conflict
resolution, as for "BTrees.Length").

--
Dieter
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


miles at jamkit

Feb 11, 2008, 1:36 AM

Post #24 of 27 (2606 views)
Permalink
Re: CMFUid [In reply to]

Hi Charlie,

Uids are wired up using the event machinery, so shouldn't need changes
to content classes.

By default, uids are applied for all content with the IContentish
interface so as long as AContentObject provides that interface, it
should get uids. You can see this in event.zcml.

Originally, the tools did not do this, so for BBB you also need to check
some properties in the annotation tool properties tab (I think): 'assign
on add' and 'assign on clone'.

HTH

Miles



Charlie Clark wrote:
> Dear all,
>
> I'm looking at using CMFUid and I'm not quite sure how to use it: do I
> need to add support for it explicitly in my objects, ie.
>
> from Products.CMFCore.PortalContent import PortalContent
>
> from Products.CMFCore.utils import getUtilityByInterfaceName
> from AccessControl import ClassSecurityInfo
>
> class AContentObject(PortalContent):
> security = ClassSecurityInfo()
>
> def __init__(self, title=None, description=None):
> uid = getUtilityByInterfaceName('portal_uidgenerator')
> self.id = uid()
>
> Or is this a case for using an adapter?
>
> from Products.CMFUid.interfaces import IUniqueIdAnnotation?
>
> class AContentObject(PortalContent):
> security = ClassSecurityInfo()
>
> def __init__(self, title=None, description=None):
> self.id = IUniqueIdAnnotation(self)
>
> which allows behaviour to be configured site wide?
>
> Charlie
> -
> Charlie Clark
> Helmholtzstr. 20
> Düsseldorf
> D- 40215
> Tel: +49-211-938-5360
> GSM: +49-178-782-6226
>
>
>
> _______________________________________________
> Zope-CMF maillist - Zope-CMF [at] lists
> http://mail.zope.org/mailman/listinfo/zope-cmf
>
> See http://collector.zope.org/CMF for bug reports and feature requests
>

_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


charlie at begeistert

Feb 12, 2008, 8:39 AM

Post #25 of 27 (2603 views)
Permalink
Re: Re: CMFUid [In reply to]

Am 11.02.2008 um 10:36 schrieb Miles:

> Hi Charlie,
>
> Uids are wired up using the event machinery, so shouldn't need
> changes to content classes.
>
> By default, uids are applied for all content with the IContentish
> interface so as long as AContentObject provides that interface, it
> should get uids. You can see this in event.zcml.
>
> Originally, the tools did not do this, so for BBB you also need to
> check some properties in the annotation tool properties tab (I
> think): 'assign on add' and 'assign on clone'.


Thanks for the explanation but I'm still struggling a bit. I don't
understand event.zcml - do I need to confifure a subscriber for my
object?

>>> a = aContentObject.aFactory()
>>> from Products.CMFCore.interfaces import IContentish
>>> IContentish.providedBy(a)
True
>>> a.getId()
''

so the object is not aware of a UID if it has one. Is this wrong way
to create such an object or should I be asking Zope to give me the
UID? If I do depend on Zope to generate a UID for me then how I do add
them to a folder? I can't use invoke_folder because that expects both
the type name and the id.

Guess it's back to perusing the books.

Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226



_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests

First page Previous page 1 2 Next page Last page  View All Zope cmf RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.