Can you tell us your current J2EE vendor, and if possible the generation strategy selected in the vendor deployment descriptor. If not, 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.

-dain

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 [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 13. Februar 2007 17:35
An: open-jpa-dev@incubator.apache.org
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?

http://incubator.apache.org/openjpa/docs/latest/manual/
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.


Reply via email to