cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Sequences for primary keys
Date Fri, 31 Mar 2006 16:24:34 GMT
1. A "default" PK generation strategy is thread-safe within a JVM.  
Most adapters (except for generic JdbcAdapter) also implement proper  
locking for cross-JVM concurrency.

2. 'Auto-increment' (aka "Database-Generated" PK) strategy is  
supposedly thread-save (but its behavior depends on the database, not  
Cayenne):

http://objectstyle.org/confluence/display/CAYDOC/Generated+Columns

3. 'Custom Sequences' strategy only works if the default strategy for  
a given adapter is also a sequence. And of course it is thread-safe.

Andrus




On Mar 31, 2006, at 6:38 PM, Mike Kienenberger wrote:

> On 3/31/06, Craig Turner <craig@synect.com> wrote:
>> I notice there's an 'auto-incremented' feature for primary keys in  
>> the
>> modeler - is this thread-safe? Also, would it be possible for us  
>> to be
>> able to manage custom sequences through the cayenne modeler in a  
>> future
>> version?
>
> Support for sequences predates support for auto-incrementing fields.
> Only certain databases support sequences though.
>
> Auto-increment and sequences as well as database-independent (pk
> table) primary key generation are supported in the current modeler.
>


Mime
View raw message