openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <>
Subject Re: AW: AW: Using @GeneratedValue for IDs on already existing tables
Date Tue, 13 Feb 2007 17:36:12 GMT
Can you tell us your current J2EE vendor, and if possible the  
generation strategy selected in the vendor deployment descriptor.  If  
can you grab the last 20 pks from one of the tables, we may be able  
to guess the strategy.

In general, if you vendor is using a UUID, you should able to use a  
OpenJPA UUID without conflicts.  If the vendor is using some sort of  
DB sequence, you should be able to start a new sequence for OpenJPA  
using a much larger starting number.


On Feb 13, 2007, at 9:00 AM, Hans J. Prueller wrote:

> thanks for this link but this section only describes the different
> algorithms that are provided to get the generated value - it does
> not mention the case what happens if we try to save a new persistent
> entity with a generated PK value that already exists in the DB?
> I can remember a legacy persistence framework that was able to retry
> the insert statement with a "second-try generated PK" just for the  
> case
> the currently generated one has already been inserted by another  
> process.
> does nobody else have a similar requirement?
> hans
>> -----Urspr√ľngliche Nachricht-----
>> Von: Abe White []
>> Gesendet: Dienstag, 13. Februar 2007 17:35
>> An:
>> Betreff: Re: AW: Using @GeneratedValue for IDs on already existing  
>> tables
>>> does openJPA provide the strategy to re-generate another value for
>>> the PK
>>> or do we have to manually deal with this case?
>> manual.html#ref_guide_sequence
>> _____________________________________________________________________ 
>> __
>> Notice:  This email message, together with any attachments, may  
>> contain
>> information  of  BEA Systems,  Inc.,  its subsidiaries  and   
>> affiliated
>> entities,  that may be confidential,  proprietary,  copyrighted   
>> and/or
>> legally privileged, and is intended solely for the use of the  
>> individual
>> or entity named in this message. If you are not the intended  
>> recipient,
>> and have received this message in error, please immediately return  
>> this
>> by email and then delete it.

View raw message