[jboss-user] [jBPM] - Async Fork Transaction Issues
Rachel Hodos
do-not-reply at jboss.com
Wed Apr 14 17:11:50 EDT 2010
Rachel Hodos [http://community.jboss.org/people/rhodos] replied to the discussion
"Async Fork Transaction Issues"
To view the discussion, visit: http://community.jboss.org/message/537515#537515
--------------------------------------------------------------
Maciej,
With the source code I sent you, I get a NullPointerException because repositoryService isn't defined.
When I add the following lines to the end of ConcurrencyTest.initialize() (and import the RepositoryService class):
repositoryService = processEngine.get(RepositoryService.class);
executionService = processEngine.getExecutionService();
the process gets farther but then throws the following exception:
13:48:55,893 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.SignalCmd at 15a4523
org.jbpm.api.JbpmException: execution[TestConcurrencySimple.7.to A] is not active: async
Then, if I comment out signalExecutionById, I get the original exception I was complaining about:
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.pvm.internal.model.ExecutionImpl#7]
How the heck did you get my source code to work??
(Sorry to keep throwing new questions at you.)
Rachel
*Full output from last scenario:*
java jpl.mipl.pgs.test.ConcurrencyTest
ConcurrencyTest.main, beginning
ConcurrencyTest, before super.setup()
jpl/mipl/pgs/test/jbpm.cfg.xml
building ProcessEngine from resource jpl/mipl/pgs/test/jbpm.cfg.xml
14:02:57,395 INF | [DispatcherThread] starting DispatcherThread
14:02:57,432 INF | [Environment] Hibernate 3.3.1.GA
14:02:57,445 INF | [Environment] hibernate.properties not found
14:02:57,457 INF | [Environment] Bytecode provider name : javassist
14:02:57,473 INF | [Environment] using JDK 1.4 java.sql.Timestamp handling
14:02:57,632 INF | [Configuration] configuring from resource: jbpm.hibernate.cfg.xml
14:02:57,633 INF | [Configuration] Configuration resource: jbpm.hibernate.cfg.xml
14:02:57,752 INF | [Configuration] Reading mappings from resource : jbpm.repository.hbm.xml
14:02:58,233 INF | [Configuration] Reading mappings from resource : jbpm.execution.hbm.xml
14:02:58,668 INF | [Configuration] Reading mappings from resource : jbpm.history.hbm.xml
14:02:58,901 INF | [Configuration] Reading mappings from resource : jbpm.task.hbm.xml
14:02:59,014 INF | [Configuration] Reading mappings from resource : jbpm.identity.hbm.xml
14:02:59,098 INF | [Configuration] Configured SessionFactory: null
14:02:59,162 INF | [DriverManagerConnectionProvider] Using Hibernate built-in connection pool (not for production use!)
14:02:59,163 INF | [DriverManagerConnectionProvider] Hibernate connection pool size: 20
14:02:59,164 INF | [DriverManagerConnectionProvider] autocommit mode: false
14:02:59,194 INF | [DriverManagerConnectionProvider] using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:mem:.
14:02:59,195 INF | [DriverManagerConnectionProvider] connection properties: {user=sa, password=****}
14:02:59,698 INF | [Dialect] Using dialect: org.hibernate.dialect.HSQLDialect
14:02:59,729 INF | [TransactionFactoryFactory] Using default transaction strategy (direct JDBC transactions)
14:02:59,736 INF | [TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
14:02:59,750 INF | [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
14:02:59,914 INF | [SessionFactoryImpl] building session factory
14:03:01,825 INF | [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
14:03:01,851 INF | [SchemaExport] Running hbm2ddl schema export
14:03:01,853 INF | [SchemaExport] exporting generated schema to database
14:03:01,906 INF | [SchemaExport] schema export complete
14:03:02,643 INF | [CheckDbCmd] jBPM version info: library[4.3], schema[null]
ConcurrencyTest, after super.setup()
setUp completed...
testActivityOrder: number of children = 2
testActivityOrder: signaling TestConcurrencySimple.7.to A
testActivityOrder: signaling TestConcurrencySimple.7.to B
ConcurrencyTest.main, after testActivityOrder
my name is A
my name is B
concurrencyTest.main, after tearDown
my name is A
my name is B
my name is A
my name is A
my name is B
my name is A
my name is B
In PrintNameMulti: state of execution: active-concurrent
In PrintNameMulti: execution id: TestConcurrencySimple.7.to A
my name is A2
14:03:09,097 WRN | [HSQLDialect] HSQLDB supports only READ_UNCOMMITTED isolation
### EXCEPTION ###########################################
14:03:09,108 SEV | [ExecuteJobCmd] exception while executing 'message[9]'
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.pvm.internal.model.ExecutionImpl#7]
at org.hibernate.dialect.lock.SelectLockingStrategy.lock(SelectLockingStrategy.java:102)
at org.hibernate.dialect.HSQLDialect$ReadUncommittedLockingStrategy.lock(HSQLDialect.java:306)
at org.hibernate.persister.entity.AbstractEntityPersister.lock(AbstractEntityPersister.java:1361)
at org.hibernate.event.def.AbstractLockUpgradeEventListener.upgradeLock(AbstractLockUpgradeEventListener.java:108)
at org.hibernate.event.def.DefaultLockEventListener.onLock(DefaultLockEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLock(SessionImpl.java:611)
at org.hibernate.impl.SessionImpl.lock(SessionImpl.java:603)
at org.jbpm.jpdl.internal.activity.JoinActivity.execute(JoinActivity.java:68)
at org.jbpm.jpdl.internal.activity.JoinActivity.execute(JoinActivity.java:49)
at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:656)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
at org.jbpm.pvm.internal.model.ExecutionImpl_$$_javassist_5.performAtomicOperationSync(ExecutionImpl_$$_javassist_5.java)
at org.jbpm.pvm.internal.model.op.ExecuteEventListenerMessage.execute(ExecuteEventListenerMessage.java:154)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:76)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:42)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
### EXCEPTION ###########################################
### EXCEPTION ###########################################
14:03:09,117 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.ExecuteJobCmd at 1a998c7
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.pvm.internal.model.ExecutionImpl#7]
at org.hibernate.dialect.lock.SelectLockingStrategy.lock(SelectLockingStrategy.java:102)
at org.hibernate.dialect.HSQLDialect$ReadUncommittedLockingStrategy.lock(HSQLDialect.java:306)
at org.hibernate.persister.entity.AbstractEntityPersister.lock(AbstractEntityPersister.java:1361)
at org.hibernate.event.def.AbstractLockUpgradeEventListener.upgradeLock(AbstractLockUpgradeEventListener.java:108)
at org.hibernate.event.def.DefaultLockEventListener.onLock(DefaultLockEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLock(SessionImpl.java:611)
at org.hibernate.impl.SessionImpl.lock(SessionImpl.java:603)
at org.jbpm.jpdl.internal.activity.JoinActivity.execute(JoinActivity.java:68)
at org.jbpm.jpdl.internal.activity.JoinActivity.execute(JoinActivity.java:49)
at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:656)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
at org.jbpm.pvm.internal.model.ExecutionImpl_$$_javassist_5.performAtomicOperationSync(ExecutionImpl_$$_javassist_5.java)
at org.jbpm.pvm.internal.model.op.ExecuteEventListenerMessage.execute(ExecuteEventListenerMessage.java:154)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:76)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:42)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
### EXCEPTION ###########################################
my name is B
In PrintNameMulti: state of execution: active-concurrent
In PrintNameMulti: execution id: TestConcurrencySimple.7.to B
my name is B2
14:03:11,700 WRN | [HSQLDialect] HSQLDB supports only READ_UNCOMMITTED isolation
### EXCEPTION ###########################################
14:03:11,702 SEV | [ExecuteJobCmd] exception while executing 'message[12]'
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.pvm.internal.model.ExecutionImpl#7]
at org.hibernate.dialect.lock.SelectLockingStrategy.lock(SelectLockingStrategy.java:102)
at org.hibernate.dialect.HSQLDialect$ReadUncommittedLockingStrategy.lock(HSQLDialect.java:306)
at org.hibernate.persister.entity.AbstractEntityPersister.lock(AbstractEntityPersister.java:1361)
at org.hibernate.event.def.AbstractLockUpgradeEventListener.upgradeLock(AbstractLockUpgradeEventListener.java:108)
at org.hibernate.event.def.DefaultLockEventListener.onLock(DefaultLockEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLock(SessionImpl.java:611)
at org.hibernate.impl.SessionImpl.lock(SessionImpl.java:603)
at org.jbpm.jpdl.internal.activity.JoinActivity.execute(JoinActivity.java:68)
at org.jbpm.jpdl.internal.activity.JoinActivity.execute(JoinActivity.java:49)
at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:656)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
at org.jbpm.pvm.internal.model.ExecutionImpl_$$_javassist_5.performAtomicOperationSync(ExecutionImpl_$$_javassist_5.java)
at org.jbpm.pvm.internal.model.op.ExecuteEventListenerMessage.execute(ExecuteEventListenerMessage.java:154)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:76)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:42)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
### EXCEPTION ###########################################
### EXCEPTION ###########################################
14:03:11,703 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.ExecuteJobCmd at 1fd9cd5
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.pvm.internal.model.ExecutionImpl#7]
at org.hibernate.dialect.lock.SelectLockingStrategy.lock(SelectLockingStrategy.java:102)
at org.hibernate.dialect.HSQLDialect$ReadUncommittedLockingStrategy.lock(HSQLDialect.java:306)
at org.hibernate.persister.entity.AbstractEntityPersister.lock(AbstractEntityPersister.java:1361)
at org.hibernate.event.def.AbstractLockUpgradeEventListener.upgradeLock(AbstractLockUpgradeEventListener.java:108)
at org.hibernate.event.def.DefaultLockEventListener.onLock(DefaultLockEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLock(SessionImpl.java:611)
at org.hibernate.impl.SessionImpl.lock(SessionImpl.java:603)
at org.jbpm.jpdl.internal.activity.JoinActivity.execute(JoinActivity.java:68)
at org.jbpm.jpdl.internal.activity.JoinActivity.execute(JoinActivity.java:49)
at org.jbpm.pvm.internal.model.op.ExecuteActivity.perform(ExecuteActivity.java:60)
at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:656)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
at org.jbpm.pvm.internal.model.ExecutionImpl_$$_javassist_5.performAtomicOperationSync(ExecutionImpl_$$_javassist_5.java)
at org.jbpm.pvm.internal.model.op.ExecuteEventListenerMessage.execute(ExecuteEventListenerMessage.java:154)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:76)
at org.jbpm.pvm.internal.cmd.ExecuteJobCmd.execute(ExecuteJobCmd.java:42)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
### EXCEPTION ###########################################
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/537515#537515]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100414/9a22d78e/attachment.html
More information about the jboss-user
mailing list