OptimisticVerificationException

I am getting the following error:
kodo.util.OptimisticVerificationException: An optimistic lock violation
was detected when flushing object
"com.xyz.packagemerge.model.Package@6bfc1ff8" with id
"com.xyz.packagemerge.model.Package-57368" to the data store. This
indicates that the object was concurrently modified in another transaction.
FailedObject:com.xyz.packagemerge.model.Package@6bfc1ff8
     at
kodo.jdbc.runtime.PreparedStatementManager.checkUpdate(PreparedStatementManager.java(Compiled
Code))
     at
kodo.jdbc.runtime.PreparedStatementManager.flushInternal(PreparedStatementManager.java(Compiled
Code))
     at
kodo.jdbc.runtime.PreparedStatementManager.flush(PreparedStatementManager.java(Inlined
Compiled Code))
     at
kodo.jdbc.runtime.PreparedStatementManager.flush(PreparedStatementManager.java(Compiled
Code))
I have tried every thing I can find, and the only solution that has worked
was to remove the jdbc-version-ind from the mapping files. This solution
is undesirable in addition to being unacceptable due to the performance
degradation it causes (10 - 50 times increase in processing time).
The application is single threaded, there is only 1 persistence manager,
and there are no other transactions (or even connnections) to the database.
Relevant configuration info:
[Thread-20] kodo.jdbc.JDBC - Using dictionary class
"kodo.jdbc.sql.OracleDictionary" (Oracle Oracle9i Enterprise Edition
Release 9.2.0.5.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.5.0 - Production ,Oracle JDBC driver 9.0.1.0.0).
javax.jdo.option.ConnectionDriverName=oracle.jdbc.driver.OracleDriver
javax.jdo.PersistenceManagerFactoryClass=kodo.jdbc.runtime.JDBCPersistenceManagerFactory
javax.jdo.option.Multithreaded=false
javax.jdo.option.NontransactionalWrite=false
javax.jdo.option.NontransactionalRead=false
javax.jdo.option.RetainValues=false
javax.jdo.option.RestoreValues=false
kodo.ConnectionFactoryProperties=(MaxActive\=5)
kodo.jdbc.DBDictionary=oracle(StoreCharsAsNumbers\=false, BatchLimit\=0)
kodo.DataCache=true(CacheSize\=5000)
kodo.RemoteCommitProvider=sjvm
kodo.QueryCache=true(CacheSize\=1000)
It appears that it could be a problem with the state-image not recognizing
the difference between null and empty string, or an inconsistency in the
data cache.

Clint-
Can you disable batch updates and see if it works? There are known
problems with some versions of the Oracle JDBC driver (including the one
you are using) that prevents incorrect update counts from being returned
from batch updates; the most common symptom of this problem is an
incorrect OptimisticVerificationException being thrown.
You should also try using version 9.0.1.0.0 of the Oracle driver,
which is known to work much better for batch updating.
Finally, what version of Kodo are you using? Recent versions (3.1.4)
should have detected this problem and issued a warning.
In article <[email protected]>, Clint LeGros wrote:
I am getting the following error:
kodo.util.OptimisticVerificationException: An optimistic lock violation
was detected when flushing object
"com.xyz.packagemerge.model.Package@6bfc1ff8" with id
"com.xyz.packagemerge.model.Package-57368" to the data store. This
indicates that the object was concurrently modified in another transaction.
FailedObject:com.xyz.packagemerge.model.Package@6bfc1ff8
     at
kodo.jdbc.runtime.PreparedStatementManager.checkUpdate(PreparedStatementManager.java(Compiled
Code))
     at
kodo.jdbc.runtime.PreparedStatementManager.flushInternal(PreparedStatementManager.java(Compiled
Code))
     at
kodo.jdbc.runtime.PreparedStatementManager.flush(PreparedStatementManager.java(Inlined
Compiled Code))
     at
kodo.jdbc.runtime.PreparedStatementManager.flush(PreparedStatementManager.java(Compiled
Code))
I have tried every thing I can find, and the only solution that has worked
was to remove the jdbc-version-ind from the mapping files. This solution
is undesirable in addition to being unacceptable due to the performance
degradation it causes (10 - 50 times increase in processing time).
The application is single threaded, there is only 1 persistence manager,
and there are no other transactions (or even connnections) to the database.
Relevant configuration info:
[Thread-20] kodo.jdbc.JDBC - Using dictionary class
"kodo.jdbc.sql.OracleDictionary" (Oracle Oracle9i Enterprise Edition
Release 9.2.0.5.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.5.0 - Production ,Oracle JDBC driver 9.0.1.0.0).
javax.jdo.option.ConnectionDriverName=oracle.jdbc.driver.OracleDriver
javax.jdo.PersistenceManagerFactoryClass=kodo.jdbc.runtime.JDBCPersistenceManagerFactory
javax.jdo.option.Multithreaded=false
javax.jdo.option.NontransactionalWrite=false
javax.jdo.option.NontransactionalRead=false
javax.jdo.option.RetainValues=false
javax.jdo.option.RestoreValues=false
kodo.ConnectionFactoryProperties=(MaxActive\=5)
kodo.jdbc.DBDictionary=oracle(StoreCharsAsNumbers\=false, BatchLimit\=0)
kodo.DataCache=true(CacheSize\=5000)
kodo.RemoteCommitProvider=sjvm
kodo.QueryCache=true(CacheSize\=1000)
It appears that it could be a problem with the state-image not recognizing
the difference between null and empty string, or an inconsistency in the
data cache.--
Marc Prud'hommeaux
SolarMetric Inc.

Similar Messages

  • ObjectNotFoundException still does not show object class

    I know I complained before but I want to emphasize it again
    Without missing object class it is very very difficult to figure out whats
    going on!!!
    Please, please fix it!!!!
    Exception in thread "main" javax.jdo.JDOUserException:
    kodo.util.ObjectNotFoundException: The instance "NO2" does not exist in the
    data store.[NO2]

    Straight forward getObjectById causes this:
    2422 TRACE [main] kodo.jdbc.SQL - <t 24347419, conn 30638546> [156 ms]
    executing prepstmnt 3874616 SELECT t0.JDO_LOCK, t0.DESCRIPTION FROM
    OBJECT_CLASS t0 WHERE t0.OBJECT_CLASS_CODE = ? [params=(String) xxx]
    Exception in thread "main" kodo.util.ObjectNotFoundException: The instance
    "xxx" does not exist in the data store.[xxx]
    at
    kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:2009)
    at
    kodo.runtime.PersistenceManagerImpl.getObjectById(PersistenceManagerImpl.java:1924)
    at peacetech.nci.cs.jdo.CsJDOHelper.getObjectClass(CsJDOHelper.java:1626)
    at peacetech.nci.cs.jdo.CsJDOHelper.getObjectClass(CsJDOHelper.java:1664)
    at peacetech.nci.cs.LoadData.main(LoadData.java:224)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
    Another example:
    Exception in thread "main" kodo.util.OptimisticVerificationException: The
    instance "33.33" does not exist in the data store.[33.33]
    at
    kodo.runtime.AttachManager.getOptimisticVerificationException(AttachManager.java:184)
    at
    kodo.runtime.AttachManager.getOptimisticVerificationException(AttachManager.java:198)
    at kodo.runtime.AttachManager.attachAll(AttachManager.java:79)
    at
    kodo.runtime.PersistenceManagerImpl.attachAll(PersistenceManagerImpl.java:4356)
    at
    peacetech.nci.cs.DetachTest.testNewObject(DetachTest.java:114)
    at peacetech.nci.cs.DetachTest.main(DetachTest.java:171)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at
    com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)

  • Optimistic transaction - Recovering after exception

    I'm looking for a usage pattern / hint for following problem:
    We are using long-running optimistic transactions, where a large number of
    JDO objects is modified during a transaction. Since multiple end users can
    modify the same JDO objects, we can get OptimisticVerificationExceptions.
    Following recovering strategies are trivial to implement:
    - accept changes of the user who committed first by calling refresh() on the
    conflicting JDO objects, discarding all changes made during the transaction
    - step back to the state where the transaction began (with restoreValues set
    to true), discarding all changes made during the transaction
    However, we did not find a simple solution for recovering the following way:
    - commit the changes of the user who received the exception, thus
    overwriting the changes of the user who committed first
    After retrieving a conflicting JDO object via getFailedObject(), it is
    either in hollow or persistent-nontransactional state (depending on the
    restoreValue property), so all changes that were made during the
    transaction are lost. The only way I can think of is to copy/clone mapped
    fields in preStore/preDelete instance callbacks and storing them in
    transient fields within the JDO object. After receiving the exception, the
    mapped fields could be set back to the values stored in the transient
    fields. This approach appears somewhat clumsy, however. Are there better
    ideas / proven usage patterns around?
    Thanks,
    Contus

    Hi,
    The JDO specification mandates that an OptimisticVerificationException is a
    fatal exception and thus any transaction is implicitly rolled back and there
    will no longer be an active optimistic transaction (hence why you are seeing
    objects as hollow or PNT depending on RestoreValues).
    The only thing that I can think of is to maybe use the detach() API to take
    a copy of the objects you've changed prior to trying the commit. Then if
    there is a failure you can begin a new tx and attach the detached
    copies...not something I've tried but might work?
    Cheers
    - Keiron
    "contus" <[email protected]> wrote in message
    news:[email protected]...
    I'm looking for a usage pattern / hint for following problem:
    We are using long-running optimistic transactions, where a large number of
    JDO objects is modified during a transaction. Since multiple end users can
    modify the same JDO objects, we can get OptimisticVerificationExceptions.
    Following recovering strategies are trivial to implement:
    - accept changes of the user who committed first by calling refresh() onthe
    conflicting JDO objects, discarding all changes made during thetransaction
    - step back to the state where the transaction began (with restoreValuesset
    to true), discarding all changes made during the transaction
    However, we did not find a simple solution for recovering the followingway:
    - commit the changes of the user who received the exception, thus
    overwriting the changes of the user who committed first
    After retrieving a conflicting JDO object via getFailedObject(), it is
    either in hollow or persistent-nontransactional state (depending on the
    restoreValue property), so all changes that were made during the
    transaction are lost. The only way I can think of is to copy/clone mapped
    fields in preStore/preDelete instance callbacks and storing them in
    transient fields within the JDO object. After receiving the exception, the
    mapped fields could be set back to the values stored in the transient
    fields. This approach appears somewhat clumsy, however. Are there better
    ideas / proven usage patterns around?
    Thanks,
    Contus

Maybe you are looking for

  • Can't import a video to Photochop CC

    I have just downloaded Photoshop CC 2014 for 32bits, and when I want to import video it says *Photoshop doesn't allow videos in this version*. Does anyone knows how to repsir it? I want to make gifs.

  • Sharing Apple Monitor between G5 and windos computer

    I seemed to have read that it is possible to connect a windows computer to the Apple monitor and share the monitor between the two computers. Anyone know what I need to to that?

  • What do I need to reinstall operating system on toshiba nb 205 mini laptop with win 7

    I want to re install the operating system on my mini laptop but not sure what I need? I boght this off of a nice older lady but she didn't give me any discs with this laptop. Would windows 7 be the actual software that came with this laptop? The numb

  • Infotype 337 - How to put the option SIADAP?

    Hi everyone, I have a limitation, I donĀ“t know how to put the option SIADAP, with the SIADAP roles in Infotype 337 (specific for Public Sector). Is a development? BADI?Table? I have a machine with this option already, and other one without, and I nee

  • 10.2.0.4 on linux x64 oracle XE

    Is there technical possibility to install 10.2.0.4 on XE edition ? patch installer ask me for name and oracle_home, i try to set XE and /usr/lib/oracle/xe/app/oracle/product/10.2.0/server, but installer says: The software can only be installed into e