Troubleshooting
Problem
When creating and updating custom objects in IBM FileNet Content Engine (CE) via CE APIs, if workload is high or the database is slow, the custom application may attempt to update the custom object when object creation hasn't completed.
Symptom
Error reported in p8_server_error.log:
ERROR [ORB.thread.pool : 2] - method name: preloadObject principal name: APIUser Global Transaction: true User Transaction: false Exception Info: com.filenet.api.exception.EngineRuntimeException: E_OBJECT_MODIFIED: The object {240753B8-2A64-4DBC-8C69-D9410D4F8514} has been modified since it was retrieved. Update sequence number mismatch; requested USN = 0, database USN = 1.
at com.filenet.engine.persist.IndependentPersister.preloadObject(IndependentPersister.java(Compiled Code))
at com.filenet.engine.persist.IndependentPersister.executeChange(IndependentPersister.java(Compiled Code))
at com.filenet.engine.persist.SubscribablePersister.executeChange(SubscribablePersister.java(Compiled Code))
at com.filenet.engine.jca.impl.RequestBrokerImpl.executeChanges(RequestBrokerImpl.java(Compiled Code))
at com.filenet.engine.jca.impl.RequestBrokerImpl.executeChanges(RequestBrokerImpl.java(Compiled Code))
at com.filenet.engine.ejb.EngineCoreBean._executeChanges(EngineCoreBean.java(Compiled Code))
at com.filenet.engine.ejb.EngineCoreBean.executeChanges(EngineCoreBean.java(Inlined Compiled Code))
at com.filenet.engine.ejb.EJSLocalStatelessEngineCore_22877cb1.executeChanges(Unknown Source)
at com.filenet.engine.ejb.EngineBean.executeChanges(EngineBean.java(Compiled Code))
at com.filenet.apiimpl.transport.ejbstubs.EJSRemoteStatelessEngine_2e64c374.executeChanges(Unknown Source)
at com.filenet.apiimpl.transport.ejbstubs._EJSRemoteStatelessEngine_2e64c374_Tie.executeChanges(_EJSRemoteStatelessEngine_2e64c374_Tie.java(Compiled Code))
at com.filenet.apiimpl.transport.ejbstubs._EJSRemoteStatelessEngine_2e64c374_Tie._invoke(_EJSRemoteStatelessEngine_2e64c374_Tie.java(Compiled Code))
at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java(Compiled Code))
at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java(Compiled Code))
at com.ibm.rmi.iiop.ORB.process(ORB.java(Compiled Code))
at com.ibm.CORBA.iiop.ORB.process(ORB.java(Compiled Code))
at com.ibm.rmi.iiop.Connection.respondTo(Connection.java(Compiled Code))
at com.ibm.rmi.iiop.Connection.doWork(Connection.java(Compiled Code))
at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java(Compiled Code))
at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
Cause
When an object is created, a sequence number is set. Every change to that object increments that sequence by 1. When creation is complete, the sequence is updated from 0 to 1. If an API update is attempted before the creation step completes, the update step could be attempting a change to sequence 0, when 1 is now the current sequence. The sequence mismatch error generated indicates the system is working as designed by following the policy of "first writer wins."
Diagnosing The Problem
Look for long running or poorly written queries causing database slowness. In addition, higher than normal ingestion, such as bulk loading to a system insufficiently tuned can impact performance that can lead to sequence mismatches.
Resolving The Problem
Address the performance/slowness as needed and make changes to the custom application to take action on the sequence mismatch error:
- Trap the E_OBJECT_MODIFIED error when it occurs.
- Fetch a new copy of the object to get the current sequence number.
- Update the newly fetched copy, thus eliminating the sequence mismatch.
More details and samples for how to proceed can be found in the following developerworks article "Writing great code with the IBM FileNet P8 APIs, Part 3: Take a number" in the section "First writer wins"
http://www.ibm.com/developerworks/data/library/techarticle/dm-0910filenetp8api/
Related Information
Was this topic helpful?
Document Information
Modified date:
17 June 2018
UID
swg21609201