title: OCAException while updating Product quantity (custom attribute)
body: <p>We have multiple application servers, and now and then our orders are failing with OCAException.</p>
  <p>The problem is that updating product quantity (custom attribute) from external system is part of our order workflow and this exception occurs sometimes, not always.</p>
  <p>I already saw discussion here <a href="https://stackoverflow.com/questions/45580096/intershop-ormexception-could-not-update-refresh-ormobject/45605135#answer-45605135">intershop ORMException could not update - refresh ORMObject</a>, so I know the issue here - updating object in other thread and/or application server. But I can't understand why this exception occurs even in our test instances when Update Quantity job is running for example in 6 AM when there is nothing else happening - no other job is running, no user activity?</p>
  <p>The job itself lasts for about 7 seconds and it is executed in one transaction pipelet which iterates over WS response objects, then gets productBO from repository by SKU, updates Quantity custom attribute and sets product offline or online based on it.</p>
  <p>Why is this happening and how to avoid/fix it?</p>
  <pre><code>[2018-12-01 06:55:09.962 +0100] [JobExecutor60679518] [Job:ESBImportQuantity] [Req:X5sK_SlynRsAAAFndZuVlWhV] ERROR com.intershop.beehive.core.internal.job.JobExecutor  - Job 'ESBImportQuantity' pipeline finished with exception! com.intershop.beehive.core.internal.pipeline.PipelineCallStackException: com.intershop.beehive.core.capi.pipeline.PipelineExecutionException: Exception occurred while executing pipelet 'ESBUpdateProductQuantity'.
      at com.intershop.beehive.core.internal.pipeline.Pipeline.executePipeline(Pipeline.java:1038)
      at com.intershop.beehive.core.internal.pipeline.PipelineProcessorImpl.executePipeline(PipelineProcessorImpl.java:641)
      at com.intershop.beehive.core.internal.pipeline.PipelineProcessorImpl.executePipeline(PipelineProcessorImpl.java:484)
      at com.intershop.beehive.pipeline.internal.PipelineEngineImpl.executePipeline(PipelineEngineImpl.java:97)
      at com.intershop.beehive.core.internal.pipeline.PipelineProcessorImpl.executePipeline(PipelineProcessorImpl.java:421)
      at com.intershop.beehive.core.internal.pipeline.PipelineProcessorImpl.executePipeline(PipelineProcessorImpl.java:250)
      at com.intershop.beehive.core.internal.job.JobExecutor.runJob(JobExecutor.java:399)
      at com.intershop.beehive.core.internal.job.JobExecutor.processTask(JobExecutor.java:171)
      at com.intershop.beehive.core.internal.environment.Worker.run(Worker.java:270)
  Caused by: com.intershop.beehive.core.capi.pipeline.PipelineExecutionException: Exception occurred while executing pipelet 'ESBUpdateProductQuantity'.
      at com.intershop.beehive.core.internal.pipeline.PipeletNode.executeNode(PipeletNode.java:381)
      at com.intershop.beehive.core.internal.pipeline.Pipeline.executeNode(Pipeline.java:1098)
      at com.intershop.beehive.core.internal.pipeline.Pipeline.executePipeline(Pipeline.java:926)
      ... 8 common frames omitted
  Caused by: com.intershop.beehive.core.capi.pipeline.PipelineExecutionException: com.intershop.beehive.orm.capi.common.OCAException: Could not UPDATE object: com.intershop.beehive.xcs.internal.product.ProductPO
  </code></pre>
  <p>The same exception occurs when system job &quot;ProcessProductNotification-TriggerNotificationFromJob&quot; runs and tries to update DomainPO object:</p>
  <pre><code>[2018-12-03 01:24:59.159 +0100] ERROR lvpislive1.vipnet.hr ES1 appserver1 [] [] com.intershop.beehive.core.pipelet.pipeline.ExecutePipeline [] [Unknown] [hwUK_SlyrrEAAAFlp31ujvES] [rSEK85q4Zc8AAAFn9y.Wg3F0] &quot;JobExecutor658081066&quot; ISH-CORE-2490: Synchronous called pipeline 'ProcessProductNotification-TriggerNotificationFromJob' of application 'a1-shop@A1-Shop-Site (app=a1.Web)' has finished with exception:  com.intershop.beehive.core.internal.pipeline.PipelineCallStackException: com.intershop.beehive.core.capi.pipeline.PipelineExecutionException: Exception occurred while executing pipelet 'UpdateSyncRecord'.
  at com.intershop.beehive.core.internal.pipeline.Pipeline.executePipeline(Pipeline.java:1038)
  at com.intershop.beehive.core.internal.pipeline.PipelineProcessorImpl.executePipeline(PipelineProcessorImpl.java:641)
  at com.intershop.beehive.core.internal.pipeline.PipelineProcessorImpl.executePipeline(PipelineProcessorImpl.java:484)
  at com.intershop.beehive.pipeline.internal.PipelineEngineImpl.executePipeline(PipelineEngineImpl.java:97)
  at com.intershop.beehive.core.internal.pipeline.PipelineProcessorImpl.executePipeline(PipelineProcessorImpl.java:421)
  at com.intershop.beehive.core.internal.pipeline.PipelineProcessorImpl.executePipeline(PipelineProcessorImpl.java:250)
  at com.intershop.beehive.core.pipelet.pipeline.ExecutePipeline.execute(ExecutePipeline.java:175)
  at com.intershop.beehive.core.internal.pipeline.PipeletNode.executeNode(PipeletNode.java:346)
  at com.intershop.beehive.core.internal.pipeline.Pipeline.executeNode(Pipeline.java:1098)
  at com.intershop.beehive.core.internal.pipeline.Pipeline.executePipeline(Pipeline.java:926)
  at com.intershop.beehive.core.internal.pipeline.PipelineProcessorImpl.executePipeline(PipelineProcessorImpl.java:641)
  at com.intershop.beehive.core.internal.pipeline.PipelineProcessorImpl.executePipeline(PipelineProcessorImpl.java:484)
  at com.intershop.beehive.pipeline.internal.PipelineEngineImpl.executePipeline(PipelineEngineImpl.java:97)
  at com.intershop.beehive.core.internal.pipeline.PipelineProcessorImpl.executePipeline(PipelineProcessorImpl.java:421)
  at com.intershop.beehive.core.internal.pipeline.PipelineProcessorImpl.executePipeline(PipelineProcessorImpl.java:250)
  at com.intershop.beehive.core.internal.job.JobExecutor.runJob(JobExecutor.java:399)
  at com.intershop.beehive.core.internal.job.JobExecutor.processTask(JobExecutor.java:171)
  at com.intershop.beehive.core.internal.environment.Worker.run(Worker.java:270)
  Caused by: com.intershop.beehive.core.capi.pipeline.PipelineExecutionException: Exception occurred while executing pipelet 'UpdateSyncRecord'.
  at com.intershop.beehive.core.internal.pipeline.PipeletNode.executeNode(PipeletNode.java:381)
  at com.intershop.beehive.core.internal.pipeline.Pipeline.executeNode(Pipeline.java:1098)
  at com.intershop.beehive.core.internal.pipeline.Pipeline.executePipeline(Pipeline.java:926)
  ... 17 common frames omitted
  Caused by: com.intershop.beehive.core.capi.pipeline.PipelineExecutionException: com.intershop.beehive.orm.capi.common.OCAException: Could not UPDATE object: com.intershop.beehive.core.internal.domain.DomainPO[com.intershop.beehive.orm.internal.state.ObjectState@65beb960[typeCode=1, status=1, parentSiteID=null, siteID=j5UK_SlytKwAAAFlTuJujvEU, entryMask=0, pageCachingAllowedFlag=false, staticContentMaxAge=null, pageCacheID=null, staticContentCacheID=null, profileID=null, serverGroup=null, businessModel=null, defaultApplicationID=null, UUID=aPIK_Sly.tEAAAFlWeJujvEU, domainID=aPIK_Sly.tEAAAFlWeJujvEU, oca=2492]]
  at com.intershop.beehive.core.internal.pipeline.PipelineRequest.commitTransaction(PipelineRequest.java:327)
  at com.intershop.beehive.core.internal.pipeline.PipeletNode.executeNode(PipeletNode.java:374)
  ... 19 common frames omitted
  Caused by: com.intershop.beehive.orm.capi.common.OCAException: Could not UPDATE object: com.intershop.beehive.core.internal.domain.DomainPO[com.intershop.beehive.orm.internal.state.ObjectState@65beb960[typeCode=1, status=1, parentSiteID=null, siteID=j5UK_SlytKwAAAFlTuJujvEU, entryMask=0, pageCachingAllowedFlag=false, staticContentMaxAge=null, pageCacheID=null, staticContentCacheID=null, profileID=null, serverGroup=null, businessModel=null, defaultApplicationID=null, UUID=aPIK_Sly.tEAAAFlWeJujvEU, domainID=aPIK_Sly.tEAAAFlWeJujvEU, oca=2492]]
  at com.intershop.beehive.orm.internal.query.SQLManagerImpl.createDMLStatement(SQLManagerImpl.java:375)
  at com.intershop.beehive.orm.internal.query.SQLManagerImpl.createUpdateStatement(SQLManagerImpl.java:252)
  at com.intershop.beehive.orm.internal.query.QueryManagerImpl.executeDMLStatement(QueryManagerImpl.java:112)
  at com.intershop.beehive.orm.internal.query.QueryManagerImpl.executeUpdateQuery(QueryManagerImpl.java:76)
  at com.intershop.beehive.orm.internal.state.StateManagerImpl.updateObjectState(StateManagerImpl.java:60)
  at com.intershop.beehive.orm.capi.common.ORMObject.prepareState(ORMObject.java:1868)
  at com.intershop.beehive.orm.capi.common.ORMObject.transactionPrepared(ORMObject.java:1807)
  at com.intershop.beehive.orm.internal.transaction.TransactionImpl.prepareTransaction(TransactionImpl.java:709)
  at com.intershop.beehive.orm.internal.transaction.TransactionImpl.commit(TransactionImpl.java:307)
  at com.intershop.beehive.core.internal.pipeline.PipelineRequest.commitTransaction(PipelineRequest.java:314)
  ... 20 common frames omitted
  </code></pre>