So, You’ll have to learn about transaction and how that all works. Because if you don’t know why it happened in the first place, I certainly can’t tell you how to avoid it
-Hal > On Oct 23, 2015, at 4:07 AM, Leonardo K. Shikida <shik...@gmail.com> wrote: > > how can I avoid it? > > [] > > Leo > > On Thu, Oct 22, 2015 at 1:08 PM, Hal Hildebrand <hal.hildebr...@me.com> > wrote: > >> It means you are using optimistic concurrency control with JPA, and that a >> modification has been detected that aborted the transaction. Something >> modified what you were reading in another txn, and - well - this txn tried >> to commit and found a different version for something it depended upon in >> the txn. Thus the error. >> >>> On Oct 22, 2015, at 5:33 AM, Leonardo K. Shikida <shik...@gmail.com> >> wrote: >>> >>> Hi >>> >>> I've got this error in my web app. >>> >>> <openjpa-2.3.0-nonfinal-1540826-r422266:1542644 fatal store error> >>> org.apache.openjpa.persistence.OptimisticLockException: Optimistic >> locking >>> errors were detected when flushing to the data store. The following >>> objects may have been concurrently modified in another transaction: >>> [com.ericsson.neas.tomee.entity.DriverJob-516036] >>> at >>> >> org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2359) >>> at >> org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2207) >>> at >>> org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2105) >>> at >> org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1876) >>> at >>> org.apache.openjpa.kernel.QueryImpl.isInMemory(QueryImpl.java:973) >>> at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:853) >>> at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:794) >>> at >>> >> org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:542) >>> at >>> org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:275) >>> at >>> >> org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:291) >>> at >>> >> org.apache.openjpa.persistence.QueryImpl.getSingleResult(QueryImpl.java:319) >>> >>> but openjpa.LockManager is set to pessimistic >>> >>> what does it mean and how can I avoid it? >>> >>> [] >>> >>> Leo >> >>