> 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
One of the reasons why we are migrating is that the current vendors generation strategy is crap - we regularly get "duplicate PK" SQL exceptions on our production servers and the vendor developers don't understand that their PK generation algorithm is not "production ready" or stable yet. I don't want to make a product down so I don't name it here but the fact is that we permanently are having stability problems with the CMP engine. The solution with hi-lo table setting the value to the current max() of the db values provided by Patrick sounds good - I think I'll give it a try. thank you! hans > -----Ursprüngliche Nachricht----- > Von: Dain Sundstrom [mailto:[EMAIL PROTECTED] > Gesendet: Dienstag, 13. Februar 2007 18:36 > An: open-jpa-dev@incubator.apache.org > Betreff: Re: AW: AW: Using @GeneratedValue for IDs on already existing > tables > > 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. > >