Can you post the definitions for both classes in the hierarchy please? -Patrick
On 9/18/07, Gene Woo <[EMAIL PROTECTED]> wrote: > Hi, > > Absolutely not. Because I only exposed this private field to a getting > method. So it's no possible to modify this value from outside of the class. > > BTW, this field is declared in Super class. Only these two entities met the > problem I described. The rest of them do not have such issue. > > Also, the error always comes with a optimistic lock error. But only one > Session Bean is working on these entities. > > Thanks, > Gene. > > > On 9/18/07, Patrick Linskey <[EMAIL PROTECTED]> wrote: > > > > > So far, my understanding on setting of the version field is a qualified > > > field(Integer, Long or DateType) with annotation @Version. Is this the > > one > > > you mentioned as manually setting? > > > > There is (presumably) some field in your object that is marked as > > @Version. Are you assigning a value to that field? > > > > -Patrick > > > > On 9/17/07, Gene Woo <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > > > I have no idea about that "manually setting the version field in your > > > application". > > > > > > So far, my understanding on setting of the version field is a qualified > > > field(Integer, Long or DateType) with annotation @Version. Is this the > > one > > > you mentioned as manually setting? > > > > > > Thanks, > > > > > > Gene. > > > > > > On 9/18/07, Patrick Linskey <[EMAIL PROTECTED]> wrote: > > > > > > > > Hi, > > > > > > > > Are you manually setting the version field in your application? > > > > > > > > -Patrick > > > > > > > > On 9/17/07, Gene Woo <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > > > > > > > I got the following error messages from application server. I am > > very > > > > > confused on that. Because this is an isolated entity without any > > > > > relationship to the rest of entities. > > > > > > > > > > <4|true|0.9.7> org.apache.openjpa.persistence.InvalidStateException: > > > > Attempt > > > > > to set column "event.update_version" to two different values: (class > > > > > java.lang.Integer)"2", (class java.lang.Integer)"3" This can occur > > when > > > > you > > > > > fail to set both sides of a two-sided relation between objects, or > > when > > > > you > > > > > map different fields to the same column, but you do not keep the > > values > > > > of > > > > > these fields in synch. > > > > > > > > > > Note: This update_version is a mapped-super class's property: @ > > > > > [EMAIL PROTECTED](name = "update_version") private Integer > > > > > _version; > > > > > > > > > > And I found the code only performed query and new/persist object. > > Not > > > > intent > > > > > to update or merge object. > > > > > > > > > > The error was found before perform query. As you know, system will > > flush > > > > > before query. Here is the stack trace: > > > > > > > > > > at org.apache.openjpa.jdbc.sql.PrimaryRow.setObject( > > > > PrimaryRow.java > > > > > :335) > > > > > at org.apache.openjpa.jdbc.sql.RowImpl.setObject( > > RowImpl.java > > > > :501) > > > > > at > > > > kodo.jdbc.meta.strats.ColumnPerLockGroupVersionStrategy.update( > > > > > ColumnPerLockGroupVersionStrategy.java:166) > > > > > at org.apache.openjpa.jdbc.meta.Version.update(Version.java > > :294) > > > > > at > > > > > > > org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.updateIndicators( > > > > > AbstractUpdateManager.java:308) > > > > > at > > org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.update( > > > > > AbstractUpdateManager.java:291) > > > > > at > > > > > > > org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.populateRowManager( > > > > > AbstractUpdateManager.java:149) > > > > > at > > org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush( > > > > > AbstractUpdateManager.java:82) > > > > > at > > org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush( > > > > > AbstractUpdateManager.java:69) > > > > > at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush( > > > > > JDBCStoreManager.java:511) > > > > > at org.apache.openjpa.kernel.DelegatingStoreManager.flush( > > > > > DelegatingStoreManager.java:127) > > > > > at org.apache.openjpa.datacache.DataCacheStoreManager.flush( > > > > > DataCacheStoreManager.java:506) > > > > > at org.apache.openjpa.kernel.DelegatingStoreManager.flush( > > > > > DelegatingStoreManager.java:127) > > > > > at org.apache.openjpa.kernel.BrokerImpl.flush( > > BrokerImpl.java > > > > :1970) > > > > > at org.apache.openjpa.kernel.BrokerImpl.flushSafe( > > > > BrokerImpl.java > > > > > :1868) > > > > > at org.apache.openjpa.kernel.BrokerImpl.flush( > > BrokerImpl.java > > > > :1639) > > > > > at org.apache.openjpa.kernel.QueryImpl.isInMemory( > > QueryImpl.java > > > > > :948) > > > > > at org.apache.openjpa.kernel.QueryImpl.execute( > > QueryImpl.java > > > > :782) > > > > > at org.apache.openjpa.kernel.QueryImpl.execute( > > QueryImpl.java > > > > :761) > > > > > at org.apache.openjpa.kernel.DelegatingQuery.execute( > > > > > DelegatingQuery.java:528) > > > > > at org.apache.openjpa.persistence.QueryImpl.execute( > > > > QueryImpl.java > > > > > :222) > > > > > at org.apache.openjpa.persistence.QueryImpl.getSingleResult( > > > > > QueryImpl.java:282) > > > > > > > > > > -- > > > > > Best Regards, > > > > > > > > > > Gene Wu > > > > > > > > > > > > > > > > > -- > > > > Patrick Linskey > > > > 202 669 5907 > > > > > > > > > > > > > > > > -- > > > Best Regards, > > > > > > Gene Woo > > > > > > > > > -- > > Patrick Linskey > > 202 669 5907 > > > > > > -- > Best Regards, > > Gene Woo > -- Patrick Linskey 202 669 5907
