I experienced exactly the same problem running in managed environment with JTA transaction.
Max. -----Original Message----- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Thursday, July 29, 2004 8:35 AM To: OJB Users List Subject: Re: Negative Sequence Numbers? Robert Crawford wrote: > Armin Waibel said: > >>Robert Crawford wrote: >> >> >>>Armin Waibel said: >>> >>> >>>>Do you only use the PB-api? This bug is odmg-api related. >>> >>> >>>I only use the PB-api. >>> >> >>Then you shouldn't get problems with negative sequence numbers. >>Can you describe me with some pseudo code an test case to reproduce your >>problem? > > Don't you use transaction demarcation or is this code snip from an managed environment with JTA transaction? Armin >>From memory, the code looks something like this: > > PersistenceBroker broker = > PersistenceBrokerFactory.createPersistenceBroker(pbKey); > User user = new User(); > user.setEmailAddress(emailAddress); > // more setters here, nothing that touches the primary key > broker.store(user); > > At this point the database has a negative number for the primary key and, > from what I can recall from my debugging, the user object has zero in the > primary key field. > > Here's the start of the class descriptor: > > <class-descriptor > class="com.kloognome.accesscontrol.ojb.UserInstance" > table="ac_users"> > <field-descriptor name="userNbr" column="user_nbr" jdbc-type="INTEGER" > primarykey="true" autoincrement="true" access="readonly"/> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]