You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ode.apache.org by "Rafal Rusin (JIRA)" <ji...@apache.org> on 2008/06/18 08:28:45 UTC

[jira] Created: (ODE-303) OptimisticLockException

OptimisticLockException
-----------------------

                 Key: ODE-303
                 URL: https://issues.apache.org/jira/browse/ODE-303
             Project: ODE
          Issue Type: Bug
    Affects Versions: 1.2
         Environment: JBI, Apache Servicemix, MySQL Internal
            Reporter: Rafal Rusin


I was trying to run a process which receives a message with correlation ID, and discards incoming requests if it's already processing a given ID. 
I did the following (simplified notation):

<receive correlation=cid/>
<flow>
  <scope>some processing</scope>
  <scope>
      <pick correlation=cid/>
      <throw>discarded</throw>
  </scope>
</flow>

Then I run 10 requests and I had a following error:

06:07:58,628 | WARN  | pool-4-thread-3 | Transaction              | action.manager.TransactionImpl  516 | Unexpected exception from beforeCompletion; transaction will roll back
<openjpa-1.0.1-r420667:592145 nonfatal 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: [org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905]
        at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2104)
        at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1954)
        at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1852)
        at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1770)
        at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:514)
        at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:498)
        at org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
        at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:257)
        at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
        at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)
Caused by: <openjpa-1.0.1-r420667:592145 nonfatal store error> org.apache.openjpa.persistence.OptimisticLockException: An optimistic lock violation was detected when flushing object
instance "org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905" to the data store.  This indicates that the object was concurrently modified in a
nother transaction.
FailedObject: org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905
        at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:101)
        at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:73)
        at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:543)
        at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:119)
        at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
        at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
        at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:514)
        at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
        ... 16 more
06:07:58,635 | DEBUG | pool-4-thread-3 | sql                      | utils.LoggingConnectionWrapper  215 | close
06:07:58,637 | DEBUG | pool-4-thread-3 | yRoleMessageExchangeImpl | ne.MyRoleMessageExchangeImpl$1  217 | Received myrole mex response callback
06:07:58,638 | ERROR | pool-4-thread-3 | SimpleScheduler          | duler.simple.SimpleScheduler$4  356 | Error while executing transaction
javax.transaction.RollbackException: Unable to commit: transaction marked for rollback
        at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:271)
        at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
        at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)



Currently, I resolved this by setting 
ode-jbi.threads.pool.size=1

But is this workaround OK? I worry that this single thread may block on some communication and the whole bpel engine will hang.

Regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (ODE-303) OptimisticLockException while using statement

Posted by "Rafal Rusin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ODE-303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rafal Rusin resolved ODE-303.
-----------------------------

    Fix Version/s: 1.3.5
                       (was: 2.0)
       Resolution: Fixed

> OptimisticLockException while using <flow/> statement
> -----------------------------------------------------
>
>                 Key: ODE-303
>                 URL: https://issues.apache.org/jira/browse/ODE-303
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Runtime
>    Affects Versions: 1.2
>         Environment: JBI, Apache Servicemix, MySQL Internal, also happens on 1.1.1 version and Derby database
>            Reporter: Rafal Rusin
>             Fix For: 1.3.5
>
>         Attachments: deadlock-test.tar.gz
>
>
> I was trying to run a process which receives a message with correlation ID, and discards incoming requests if it's already processing a given ID. 
> I did the following (simplified notation):
> <receive correlation=cid/>
> <flow>
>   <scope>some processing</scope>
>   <scope>
>       <pick correlation=cid/>
>       <throw>discarded</throw>
>   </scope>
> </flow>
> Then I run 10 requests and I had a following error:
> 06:07:58,628 | WARN  | pool-4-thread-3 | Transaction              | action.manager.TransactionImpl  516 | Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.0.1-r420667:592145 nonfatal 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: [org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905]
>         at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2104)
>         at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1954)
>         at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1852)
>         at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1770)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:514)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:498)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:257)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: <openjpa-1.0.1-r420667:592145 nonfatal store error> org.apache.openjpa.persistence.OptimisticLockException: An optimistic lock violation was detected when flushing object
> instance "org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905" to the data store.  This indicates that the object was concurrently modified in a
> nother transaction.
> FailedObject: org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:101)
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:73)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:543)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:119)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
>         at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:514)
>         at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
>         ... 16 more
> 06:07:58,635 | DEBUG | pool-4-thread-3 | sql                      | utils.LoggingConnectionWrapper  215 | close
> 06:07:58,637 | DEBUG | pool-4-thread-3 | yRoleMessageExchangeImpl | ne.MyRoleMessageExchangeImpl$1  217 | Received myrole mex response callback
> 06:07:58,638 | ERROR | pool-4-thread-3 | SimpleScheduler          | duler.simple.SimpleScheduler$4  356 | Error while executing transaction
> javax.transaction.RollbackException: Unable to commit: transaction marked for rollback
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:271)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Currently, I resolved this by setting 
> ode-jbi.threads.pool.size=1
> But is this workaround OK? I worry that this single thread may block on some communication and the whole bpel engine will hang.
> Regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-303) OptimisticLockException

Posted by "Rafal Rusin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608675#action_12608675 ] 

Rafal Rusin commented on ODE-303:
---------------------------------

>> What do you mean by "invoke statements work synchronously" ? We have to keep a thread holding the connection, otherwise we lose the transport connection. However and invocation doesn't block the engine as it's asynchronous with respect to the communication layer.

If you say that bpel engine is not blocked during processing invoke, but only the communication layer, then it's good. But my tests with ODE JBI 1.2-RC1 in JBoss seem to show something other, because the following example hangs in JBoss and works fine in JBI with threads.pool.size set to 1:

A:
 receive M
 invoke B
 reply M

B:
 receive M
 reply M

Regards


> OptimisticLockException
> -----------------------
>
>                 Key: ODE-303
>                 URL: https://issues.apache.org/jira/browse/ODE-303
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Runtime
>    Affects Versions: 1.2
>         Environment: JBI, Apache Servicemix, MySQL Internal, also happens on 1.1.1 version and Derby database
>            Reporter: Rafal Rusin
>         Attachments: deadlock-test.tar.gz
>
>
> I was trying to run a process which receives a message with correlation ID, and discards incoming requests if it's already processing a given ID. 
> I did the following (simplified notation):
> <receive correlation=cid/>
> <flow>
>   <scope>some processing</scope>
>   <scope>
>       <pick correlation=cid/>
>       <throw>discarded</throw>
>   </scope>
> </flow>
> Then I run 10 requests and I had a following error:
> 06:07:58,628 | WARN  | pool-4-thread-3 | Transaction              | action.manager.TransactionImpl  516 | Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.0.1-r420667:592145 nonfatal 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: [org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905]
>         at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2104)
>         at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1954)
>         at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1852)
>         at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1770)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:514)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:498)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:257)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: <openjpa-1.0.1-r420667:592145 nonfatal store error> org.apache.openjpa.persistence.OptimisticLockException: An optimistic lock violation was detected when flushing object
> instance "org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905" to the data store.  This indicates that the object was concurrently modified in a
> nother transaction.
> FailedObject: org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:101)
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:73)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:543)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:119)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
>         at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:514)
>         at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
>         ... 16 more
> 06:07:58,635 | DEBUG | pool-4-thread-3 | sql                      | utils.LoggingConnectionWrapper  215 | close
> 06:07:58,637 | DEBUG | pool-4-thread-3 | yRoleMessageExchangeImpl | ne.MyRoleMessageExchangeImpl$1  217 | Received myrole mex response callback
> 06:07:58,638 | ERROR | pool-4-thread-3 | SimpleScheduler          | duler.simple.SimpleScheduler$4  356 | Error while executing transaction
> javax.transaction.RollbackException: Unable to commit: transaction marked for rollback
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:271)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Currently, I resolved this by setting 
> ode-jbi.threads.pool.size=1
> But is this workaround OK? I worry that this single thread may block on some communication and the whole bpel engine will hang.
> Regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-303) OptimisticLockException

Posted by "Rafal Rusin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608678#action_12608678 ] 

Rafal Rusin commented on ODE-303:
---------------------------------

I had some related problems with concurrency besides the optimisticlockexception, in communication layer. 
When I used threads.pool.size=1, there were cases when processes didn't complete, but stayed ACTIVE. I think there was problem with concurrent operating on database by communication layer and bpel engine. 
So I used an external database pool connection with max active connections set to 1. Then I think all synchronization was appropriate, because it worked like a global mutex for database operations. I run some tests and it looks like it works fine.

> OptimisticLockException
> -----------------------
>
>                 Key: ODE-303
>                 URL: https://issues.apache.org/jira/browse/ODE-303
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Runtime
>    Affects Versions: 1.2
>         Environment: JBI, Apache Servicemix, MySQL Internal, also happens on 1.1.1 version and Derby database
>            Reporter: Rafal Rusin
>         Attachments: deadlock-test.tar.gz
>
>
> I was trying to run a process which receives a message with correlation ID, and discards incoming requests if it's already processing a given ID. 
> I did the following (simplified notation):
> <receive correlation=cid/>
> <flow>
>   <scope>some processing</scope>
>   <scope>
>       <pick correlation=cid/>
>       <throw>discarded</throw>
>   </scope>
> </flow>
> Then I run 10 requests and I had a following error:
> 06:07:58,628 | WARN  | pool-4-thread-3 | Transaction              | action.manager.TransactionImpl  516 | Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.0.1-r420667:592145 nonfatal 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: [org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905]
>         at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2104)
>         at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1954)
>         at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1852)
>         at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1770)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:514)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:498)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:257)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: <openjpa-1.0.1-r420667:592145 nonfatal store error> org.apache.openjpa.persistence.OptimisticLockException: An optimistic lock violation was detected when flushing object
> instance "org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905" to the data store.  This indicates that the object was concurrently modified in a
> nother transaction.
> FailedObject: org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:101)
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:73)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:543)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:119)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
>         at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:514)
>         at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
>         ... 16 more
> 06:07:58,635 | DEBUG | pool-4-thread-3 | sql                      | utils.LoggingConnectionWrapper  215 | close
> 06:07:58,637 | DEBUG | pool-4-thread-3 | yRoleMessageExchangeImpl | ne.MyRoleMessageExchangeImpl$1  217 | Received myrole mex response callback
> 06:07:58,638 | ERROR | pool-4-thread-3 | SimpleScheduler          | duler.simple.SimpleScheduler$4  356 | Error while executing transaction
> javax.transaction.RollbackException: Unable to commit: transaction marked for rollback
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:271)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Currently, I resolved this by setting 
> ode-jbi.threads.pool.size=1
> But is this workaround OK? I worry that this single thread may block on some communication and the whole bpel engine will hang.
> Regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-303) OptimisticLockException

Posted by "Rafal Rusin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12605897#action_12605897 ] 

Rafal Rusin commented on ODE-303:
---------------------------------

I noticed that <invoke/> statements block worker thread synchronously. So I suggest to implement them asynchronously (as two actions send and receive). 
I think it's worth doing, because configuring BPEL engine in 1 worker thread solves concurrency problems (possibly not recognized yet), like above.

> OptimisticLockException
> -----------------------
>
>                 Key: ODE-303
>                 URL: https://issues.apache.org/jira/browse/ODE-303
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Runtime
>    Affects Versions: 1.2
>         Environment: JBI, Apache Servicemix, MySQL Internal, also happens on 1.1.1 version and Derby database
>            Reporter: Rafal Rusin
>
> I was trying to run a process which receives a message with correlation ID, and discards incoming requests if it's already processing a given ID. 
> I did the following (simplified notation):
> <receive correlation=cid/>
> <flow>
>   <scope>some processing</scope>
>   <scope>
>       <pick correlation=cid/>
>       <throw>discarded</throw>
>   </scope>
> </flow>
> Then I run 10 requests and I had a following error:
> 06:07:58,628 | WARN  | pool-4-thread-3 | Transaction              | action.manager.TransactionImpl  516 | Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.0.1-r420667:592145 nonfatal 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: [org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905]
>         at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2104)
>         at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1954)
>         at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1852)
>         at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1770)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:514)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:498)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:257)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: <openjpa-1.0.1-r420667:592145 nonfatal store error> org.apache.openjpa.persistence.OptimisticLockException: An optimistic lock violation was detected when flushing object
> instance "org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905" to the data store.  This indicates that the object was concurrently modified in a
> nother transaction.
> FailedObject: org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:101)
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:73)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:543)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:119)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
>         at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:514)
>         at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
>         ... 16 more
> 06:07:58,635 | DEBUG | pool-4-thread-3 | sql                      | utils.LoggingConnectionWrapper  215 | close
> 06:07:58,637 | DEBUG | pool-4-thread-3 | yRoleMessageExchangeImpl | ne.MyRoleMessageExchangeImpl$1  217 | Received myrole mex response callback
> 06:07:58,638 | ERROR | pool-4-thread-3 | SimpleScheduler          | duler.simple.SimpleScheduler$4  356 | Error while executing transaction
> javax.transaction.RollbackException: Unable to commit: transaction marked for rollback
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:271)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Currently, I resolved this by setting 
> ode-jbi.threads.pool.size=1
> But is this workaround OK? I worry that this single thread may block on some communication and the whole bpel engine will hang.
> Regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ODE-303) OptimisticLockException

Posted by "Rafal Rusin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ODE-303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rafal Rusin updated ODE-303:
----------------------------

    Component/s: BPEL Runtime
    Environment: JBI, Apache Servicemix, MySQL Internal, also happens on 1.1.1 version and Derby database  (was: JBI, Apache Servicemix, MySQL Internal)

> OptimisticLockException
> -----------------------
>
>                 Key: ODE-303
>                 URL: https://issues.apache.org/jira/browse/ODE-303
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Runtime
>    Affects Versions: 1.2
>         Environment: JBI, Apache Servicemix, MySQL Internal, also happens on 1.1.1 version and Derby database
>            Reporter: Rafal Rusin
>
> I was trying to run a process which receives a message with correlation ID, and discards incoming requests if it's already processing a given ID. 
> I did the following (simplified notation):
> <receive correlation=cid/>
> <flow>
>   <scope>some processing</scope>
>   <scope>
>       <pick correlation=cid/>
>       <throw>discarded</throw>
>   </scope>
> </flow>
> Then I run 10 requests and I had a following error:
> 06:07:58,628 | WARN  | pool-4-thread-3 | Transaction              | action.manager.TransactionImpl  516 | Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.0.1-r420667:592145 nonfatal 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: [org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905]
>         at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2104)
>         at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1954)
>         at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1852)
>         at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1770)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:514)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:498)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:257)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: <openjpa-1.0.1-r420667:592145 nonfatal store error> org.apache.openjpa.persistence.OptimisticLockException: An optimistic lock violation was detected when flushing object
> instance "org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905" to the data store.  This indicates that the object was concurrently modified in a
> nother transaction.
> FailedObject: org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:101)
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:73)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:543)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:119)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
>         at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:514)
>         at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
>         ... 16 more
> 06:07:58,635 | DEBUG | pool-4-thread-3 | sql                      | utils.LoggingConnectionWrapper  215 | close
> 06:07:58,637 | DEBUG | pool-4-thread-3 | yRoleMessageExchangeImpl | ne.MyRoleMessageExchangeImpl$1  217 | Received myrole mex response callback
> 06:07:58,638 | ERROR | pool-4-thread-3 | SimpleScheduler          | duler.simple.SimpleScheduler$4  356 | Error while executing transaction
> javax.transaction.RollbackException: Unable to commit: transaction marked for rollback
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:271)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Currently, I resolved this by setting 
> ode-jbi.threads.pool.size=1
> But is this workaround OK? I worry that this single thread may block on some communication and the whole bpel engine will hang.
> Regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-303) OptimisticLockException while using statement

Posted by "Rafal Rusin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12912350#action_12912350 ] 

Rafal Rusin commented on ODE-303:
---------------------------------

This should be resolved in trunk, since there were two scenarios:
First involved concurrent timer and receive processing, which is fixed by this:


                   } else if (routing.messageRoute != null) {
                       // Found a route, hitting it
+                      _engine.acquireInstanceLock(routing.messageRoute.getTargetInstance().getInstanceId());
                       target.invokeInstance(mex, routing);
                       return true;

from  ODE-829: if process is retired the inflight instances dont work (thanks to Anurag Aggarwal)


Second is this:

commit 57e6d71bc153464ab71eb982293d138abbaf85b6
Author: Rafal Konrad Rusin <rr...@apache.org>
Date:   Wed Jun 30 22:33:12 2010 +0000

    Second matcher + logging fix for job retries
    
    git-svn-id: https://svn.apache.org/repos/asf/ode/trunk@959463 13f79535-47bb-0310-9956-ffa450edef68



> OptimisticLockException while using <flow/> statement
> -----------------------------------------------------
>
>                 Key: ODE-303
>                 URL: https://issues.apache.org/jira/browse/ODE-303
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Runtime
>    Affects Versions: 1.2
>         Environment: JBI, Apache Servicemix, MySQL Internal, also happens on 1.1.1 version and Derby database
>            Reporter: Rafal Rusin
>             Fix For: 2.0
>
>         Attachments: deadlock-test.tar.gz
>
>
> I was trying to run a process which receives a message with correlation ID, and discards incoming requests if it's already processing a given ID. 
> I did the following (simplified notation):
> <receive correlation=cid/>
> <flow>
>   <scope>some processing</scope>
>   <scope>
>       <pick correlation=cid/>
>       <throw>discarded</throw>
>   </scope>
> </flow>
> Then I run 10 requests and I had a following error:
> 06:07:58,628 | WARN  | pool-4-thread-3 | Transaction              | action.manager.TransactionImpl  516 | Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.0.1-r420667:592145 nonfatal 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: [org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905]
>         at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2104)
>         at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1954)
>         at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1852)
>         at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1770)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:514)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:498)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:257)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: <openjpa-1.0.1-r420667:592145 nonfatal store error> org.apache.openjpa.persistence.OptimisticLockException: An optimistic lock violation was detected when flushing object
> instance "org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905" to the data store.  This indicates that the object was concurrently modified in a
> nother transaction.
> FailedObject: org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:101)
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:73)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:543)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:119)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
>         at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:514)
>         at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
>         ... 16 more
> 06:07:58,635 | DEBUG | pool-4-thread-3 | sql                      | utils.LoggingConnectionWrapper  215 | close
> 06:07:58,637 | DEBUG | pool-4-thread-3 | yRoleMessageExchangeImpl | ne.MyRoleMessageExchangeImpl$1  217 | Received myrole mex response callback
> 06:07:58,638 | ERROR | pool-4-thread-3 | SimpleScheduler          | duler.simple.SimpleScheduler$4  356 | Error while executing transaction
> javax.transaction.RollbackException: Unable to commit: transaction marked for rollback
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:271)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Currently, I resolved this by setting 
> ode-jbi.threads.pool.size=1
> But is this workaround OK? I worry that this single thread may block on some communication and the whole bpel engine will hang.
> Regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ODE-303) OptimisticLockException

Posted by "Rafal Rusin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ODE-303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rafal Rusin updated ODE-303:
----------------------------

    Attachment: deadlock-test.tar.gz

Here it is.
You need to deploy process and run a following command for concurrent requests invocation:

source parallel-test
all


I tested it on JBoss with Derby and obtained Dead Locks 

Caused by: ERROR 40001: A lock could not be obtained due to a deadlock, cycle of locks and waiters is...

But on MySql it should throw OptimisticLockException, and on JBI versions it should behave similarly. 

Regards

> OptimisticLockException
> -----------------------
>
>                 Key: ODE-303
>                 URL: https://issues.apache.org/jira/browse/ODE-303
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Runtime
>    Affects Versions: 1.2
>         Environment: JBI, Apache Servicemix, MySQL Internal, also happens on 1.1.1 version and Derby database
>            Reporter: Rafal Rusin
>         Attachments: deadlock-test.tar.gz
>
>
> I was trying to run a process which receives a message with correlation ID, and discards incoming requests if it's already processing a given ID. 
> I did the following (simplified notation):
> <receive correlation=cid/>
> <flow>
>   <scope>some processing</scope>
>   <scope>
>       <pick correlation=cid/>
>       <throw>discarded</throw>
>   </scope>
> </flow>
> Then I run 10 requests and I had a following error:
> 06:07:58,628 | WARN  | pool-4-thread-3 | Transaction              | action.manager.TransactionImpl  516 | Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.0.1-r420667:592145 nonfatal 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: [org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905]
>         at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2104)
>         at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1954)
>         at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1852)
>         at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1770)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:514)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:498)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:257)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: <openjpa-1.0.1-r420667:592145 nonfatal store error> org.apache.openjpa.persistence.OptimisticLockException: An optimistic lock violation was detected when flushing object
> instance "org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905" to the data store.  This indicates that the object was concurrently modified in a
> nother transaction.
> FailedObject: org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:101)
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:73)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:543)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:119)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
>         at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:514)
>         at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
>         ... 16 more
> 06:07:58,635 | DEBUG | pool-4-thread-3 | sql                      | utils.LoggingConnectionWrapper  215 | close
> 06:07:58,637 | DEBUG | pool-4-thread-3 | yRoleMessageExchangeImpl | ne.MyRoleMessageExchangeImpl$1  217 | Received myrole mex response callback
> 06:07:58,638 | ERROR | pool-4-thread-3 | SimpleScheduler          | duler.simple.SimpleScheduler$4  356 | Error while executing transaction
> javax.transaction.RollbackException: Unable to commit: transaction marked for rollback
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:271)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Currently, I resolved this by setting 
> ode-jbi.threads.pool.size=1
> But is this workaround OK? I worry that this single thread may block on some communication and the whole bpel engine will hang.
> Regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-303) OptimisticLockException

Posted by "Matthieu Riou (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12605991#action_12605991 ] 

Matthieu Riou commented on ODE-303:
-----------------------------------

What do you mean by "invoke statements work synchronously" ? We have to keep a thread holding the connection, otherwise we lose the transport connection. However and invocation doesn't block the engine as it's asynchronous with respect to the communication layer.

I haven't experient concurrent modification exceptions so far, could you attach your process or a simple test case that would reproduce this so I can have a look?

> OptimisticLockException
> -----------------------
>
>                 Key: ODE-303
>                 URL: https://issues.apache.org/jira/browse/ODE-303
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Runtime
>    Affects Versions: 1.2
>         Environment: JBI, Apache Servicemix, MySQL Internal, also happens on 1.1.1 version and Derby database
>            Reporter: Rafal Rusin
>
> I was trying to run a process which receives a message with correlation ID, and discards incoming requests if it's already processing a given ID. 
> I did the following (simplified notation):
> <receive correlation=cid/>
> <flow>
>   <scope>some processing</scope>
>   <scope>
>       <pick correlation=cid/>
>       <throw>discarded</throw>
>   </scope>
> </flow>
> Then I run 10 requests and I had a following error:
> 06:07:58,628 | WARN  | pool-4-thread-3 | Transaction              | action.manager.TransactionImpl  516 | Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.0.1-r420667:592145 nonfatal 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: [org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905]
>         at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2104)
>         at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1954)
>         at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1852)
>         at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1770)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:514)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:498)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:257)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: <openjpa-1.0.1-r420667:592145 nonfatal store error> org.apache.openjpa.persistence.OptimisticLockException: An optimistic lock violation was detected when flushing object
> instance "org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905" to the data store.  This indicates that the object was concurrently modified in a
> nother transaction.
> FailedObject: org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:101)
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:73)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:543)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:119)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
>         at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:514)
>         at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
>         ... 16 more
> 06:07:58,635 | DEBUG | pool-4-thread-3 | sql                      | utils.LoggingConnectionWrapper  215 | close
> 06:07:58,637 | DEBUG | pool-4-thread-3 | yRoleMessageExchangeImpl | ne.MyRoleMessageExchangeImpl$1  217 | Received myrole mex response callback
> 06:07:58,638 | ERROR | pool-4-thread-3 | SimpleScheduler          | duler.simple.SimpleScheduler$4  356 | Error while executing transaction
> javax.transaction.RollbackException: Unable to commit: transaction marked for rollback
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:271)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Currently, I resolved this by setting 
> ode-jbi.threads.pool.size=1
> But is this workaround OK? I worry that this single thread may block on some communication and the whole bpel engine will hang.
> Regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-303) OptimisticLockException

Posted by "Rafal Rusin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12624588#action_12624588 ] 

Rafal Rusin commented on ODE-303:
---------------------------------

A following patch (joining bpel worker pool and JBI Receiver pool) + setting in ode-jbi.properties ode-jbi.threads.pool.size=1 resolves OptimisticLocking problems while using <flow/> construct. This is a workaround, not final fix.

Index: jbi/src/main/java/org/apache/ode/jbi/Receiver.java
===================================================================
--- jbi/src/main/java/org/apache/ode/jbi/Receiver.java (.../upstream/APACHE_ODE_1.2/jbi/src/main/java/org/apache/ode/jbi/Receiver.java) (revision 42994)
+++ jbi/src/main/java/org/apache/ode/jbi/Receiver.java (.../p4esb-1.2/jbi/src/main/java/org/apache/ode/jbi/Receiver.java) (revision 44173)
@@ -69,7 +69,8 @@
     public Receiver(OdeContext context) {
         _odeContext = context;
         _thread = new Thread(this);
- _executorService = Executors.newFixedThreadPool(THREADPOOL_SIZE);
+ _executorService = context._executorService;
+ //_executorService = Executors.newFixedThreadPool(THREADPOOL_SIZE);
     }

     /**

Regards

> OptimisticLockException
> -----------------------
>
>                 Key: ODE-303
>                 URL: https://issues.apache.org/jira/browse/ODE-303
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Runtime
>    Affects Versions: 1.2
>         Environment: JBI, Apache Servicemix, MySQL Internal, also happens on 1.1.1 version and Derby database
>            Reporter: Rafal Rusin
>         Attachments: deadlock-test.tar.gz
>
>
> I was trying to run a process which receives a message with correlation ID, and discards incoming requests if it's already processing a given ID. 
> I did the following (simplified notation):
> <receive correlation=cid/>
> <flow>
>   <scope>some processing</scope>
>   <scope>
>       <pick correlation=cid/>
>       <throw>discarded</throw>
>   </scope>
> </flow>
> Then I run 10 requests and I had a following error:
> 06:07:58,628 | WARN  | pool-4-thread-3 | Transaction              | action.manager.TransactionImpl  516 | Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.0.1-r420667:592145 nonfatal 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: [org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905]
>         at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2104)
>         at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1954)
>         at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1852)
>         at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1770)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:514)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:498)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:257)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: <openjpa-1.0.1-r420667:592145 nonfatal store error> org.apache.openjpa.persistence.OptimisticLockException: An optimistic lock violation was detected when flushing object
> instance "org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905" to the data store.  This indicates that the object was concurrently modified in a
> nother transaction.
> FailedObject: org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:101)
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:73)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:543)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:119)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
>         at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:514)
>         at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
>         ... 16 more
> 06:07:58,635 | DEBUG | pool-4-thread-3 | sql                      | utils.LoggingConnectionWrapper  215 | close
> 06:07:58,637 | DEBUG | pool-4-thread-3 | yRoleMessageExchangeImpl | ne.MyRoleMessageExchangeImpl$1  217 | Received myrole mex response callback
> 06:07:58,638 | ERROR | pool-4-thread-3 | SimpleScheduler          | duler.simple.SimpleScheduler$4  356 | Error while executing transaction
> javax.transaction.RollbackException: Unable to commit: transaction marked for rollback
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:271)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Currently, I resolved this by setting 
> ode-jbi.threads.pool.size=1
> But is this workaround OK? I worry that this single thread may block on some communication and the whole bpel engine will hang.
> Regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ODE-303) OptimisticLockException

Posted by "Rafal Rusin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ODE-303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12605904#action_12605904 ] 

Rafal Rusin commented on ODE-303:
---------------------------------

To be more precise, <invoke/> statements work synchronously (which is bad) in version 1.2RC1 in JBoss (with axis2), but they work asynchronously in 1.2RC1 in ServiceMix JBI (and this is very good news). 
However I've got some processes deployed in JBoss (and migration won't be easy), so I'd appreciate if you could give me some advice on how I could make it asynchronous in J2EE version.


> OptimisticLockException
> -----------------------
>
>                 Key: ODE-303
>                 URL: https://issues.apache.org/jira/browse/ODE-303
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Runtime
>    Affects Versions: 1.2
>         Environment: JBI, Apache Servicemix, MySQL Internal, also happens on 1.1.1 version and Derby database
>            Reporter: Rafal Rusin
>
> I was trying to run a process which receives a message with correlation ID, and discards incoming requests if it's already processing a given ID. 
> I did the following (simplified notation):
> <receive correlation=cid/>
> <flow>
>   <scope>some processing</scope>
>   <scope>
>       <pick correlation=cid/>
>       <throw>discarded</throw>
>   </scope>
> </flow>
> Then I run 10 requests and I had a following error:
> 06:07:58,628 | WARN  | pool-4-thread-3 | Transaction              | action.manager.TransactionImpl  516 | Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.0.1-r420667:592145 nonfatal 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: [org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905]
>         at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2104)
>         at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1954)
>         at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1852)
>         at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1770)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:514)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:498)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:257)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: <openjpa-1.0.1-r420667:592145 nonfatal store error> org.apache.openjpa.persistence.OptimisticLockException: An optimistic lock violation was detected when flushing object
> instance "org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905" to the data store.  This indicates that the object was concurrently modified in a
> nother transaction.
> FailedObject: org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:101)
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:73)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:543)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:119)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
>         at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:514)
>         at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
>         ... 16 more
> 06:07:58,635 | DEBUG | pool-4-thread-3 | sql                      | utils.LoggingConnectionWrapper  215 | close
> 06:07:58,637 | DEBUG | pool-4-thread-3 | yRoleMessageExchangeImpl | ne.MyRoleMessageExchangeImpl$1  217 | Received myrole mex response callback
> 06:07:58,638 | ERROR | pool-4-thread-3 | SimpleScheduler          | duler.simple.SimpleScheduler$4  356 | Error while executing transaction
> javax.transaction.RollbackException: Unable to commit: transaction marked for rollback
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:271)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Currently, I resolved this by setting 
> ode-jbi.threads.pool.size=1
> But is this workaround OK? I worry that this single thread may block on some communication and the whole bpel engine will hang.
> Regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ODE-303) OptimisticLockException while using statement

Posted by "Rafal Rusin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ODE-303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rafal Rusin updated ODE-303:
----------------------------

    Summary: OptimisticLockException while using <flow/> statement  (was: OptimisticLockException)

> OptimisticLockException while using <flow/> statement
> -----------------------------------------------------
>
>                 Key: ODE-303
>                 URL: https://issues.apache.org/jira/browse/ODE-303
>             Project: ODE
>          Issue Type: Bug
>          Components: BPEL Runtime
>    Affects Versions: 1.2
>         Environment: JBI, Apache Servicemix, MySQL Internal, also happens on 1.1.1 version and Derby database
>            Reporter: Rafal Rusin
>         Attachments: deadlock-test.tar.gz
>
>
> I was trying to run a process which receives a message with correlation ID, and discards incoming requests if it's already processing a given ID. 
> I did the following (simplified notation):
> <receive correlation=cid/>
> <flow>
>   <scope>some processing</scope>
>   <scope>
>       <pick correlation=cid/>
>       <throw>discarded</throw>
>   </scope>
> </flow>
> Then I run 10 requests and I had a following error:
> 06:07:58,628 | WARN  | pool-4-thread-3 | Transaction              | action.manager.TransactionImpl  516 | Unexpected exception from beforeCompletion; transaction will roll back
> <openjpa-1.0.1-r420667:592145 nonfatal 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: [org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905]
>         at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2104)
>         at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1954)
>         at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1852)
>         at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1770)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:514)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:498)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:257)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: <openjpa-1.0.1-r420667:592145 nonfatal store error> org.apache.openjpa.persistence.OptimisticLockException: An optimistic lock violation was detected when flushing object
> instance "org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905" to the data store.  This indicates that the object was concurrently modified in a
> nother transaction.
> FailedObject: org.apache.ode.dao.jpa.MessageRouteDAOImpl-org.apache.ode.dao.jpa.MessageRouteDAOImpl-905
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:101)
>         at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:73)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:543)
>         at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:119)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
>         at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
>         at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:514)
>         at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
>         ... 16 more
> 06:07:58,635 | DEBUG | pool-4-thread-3 | sql                      | utils.LoggingConnectionWrapper  215 | close
> 06:07:58,637 | DEBUG | pool-4-thread-3 | yRoleMessageExchangeImpl | ne.MyRoleMessageExchangeImpl$1  217 | Received myrole mex response callback
> 06:07:58,638 | ERROR | pool-4-thread-3 | SimpleScheduler          | duler.simple.SimpleScheduler$4  356 | Error while executing transaction
> javax.transaction.RollbackException: Unable to commit: transaction marked for rollback
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:271)
>         at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:181)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:332)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Currently, I resolved this by setting 
> ode-jbi.threads.pool.size=1
> But is this workaround OK? I worry that this single thread may block on some communication and the whole bpel engine will hang.
> Regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.