TaskList issues after using JPA in service tasks
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2011 05:35 PM
Hello,
With JTA and CMP i have transaction issues when i create JPA entities using
a EJB looked up via JNDI from within a service task and store this entities as
process variables and later reuse them in another service task. Using the
entities within the servce task and the EJB is no problem as they are persisted
ok, but i have problems getting the task list via the TaskService after i run
a process with such service and user tasks. It seems that Activiti is then not
able to get a db session:
What can be wrong here in the Activiti configuration? Or maybe somewhere else?
Thanks in advance
Chris
With JTA and CMP i have transaction issues when i create JPA entities using
a EJB looked up via JNDI from within a service task and store this entities as
process variables and later reuse them in another service task. Using the
entities within the servce task and the EJB is no problem as they are persisted
ok, but i have problems getting the task list via the TaskService after i run
a process with such service and user tasks. It seems that Activiti is then not
able to get a db session:
org.apache.ibatis.exceptions.PersistenceException: ### Error opening session. Cause: java.sql.SQLException: Error in allocating a connection. Cause: java.lang.RuntimeException: Got exception during XAResource.start:### Cause: java.sql.SQLException: Error in allocating a connection. Cause: java.lang.RuntimeException: Got exception during XAResource.start: at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8) at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSessionFromDataSource(DefaultSqlSessionFactory.java:81) at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSession(DefaultSqlSessionFactory.java:32) at org.activiti.engine.impl.db.DbSqlSession.<init>(DbSqlSession.java:86) at org.activiti.engine.impl.db.DbSqlSessionFactory.openSession(DbSqlSessionFactory.java:77) at org.activiti.engine.impl.interceptor.CommandContext.getSession(CommandContext.java:177) at org.activiti.engine.impl.persistence.AbstractManager.getSession(AbstractManager.java:56) at org.activiti.engine.impl.persistence.AbstractManager.getDbSqlSession(AbstractManager.java:52) at org.activiti.engine.impl.persistence.entity.TaskManager.findTasksByQueryCriteria(TaskManager.java:89) at org.activiti.engine.impl.TaskQueryImpl.executeList(TaskQueryImpl.java:334) at org.activiti.engine.impl.AbstractQuery.execute(AbstractQuery.java:138) at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24) at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42) at org.activiti.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:59) at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33) at org.activiti.engine.impl.AbstractQuery.list(AbstractQuery.java:112) at erp.web.faces.beans.activiti.TaskList.getOwnTasks(TaskList.java:62)
What can be wrong here in the Activiti configuration? Or maybe somewhere else?
<jee:jndi-lookup jndi-name="jdbc/MysqlErp" id="dataSource" /> <jee:jndi-lookup jndi-name="java:appserver/TransactionManager" id="transactionManager" /> <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.JtaProcessEngineConfiguration"> <property name="transactionManager" ref="transactionManager"/> <property name="transactionsExternallyManaged" value="false" /> <property name="dataSource" ref="dataSource" /> <property name="databaseSchemaUpdate" value="true" /> <property name="databaseType" value="mysql" /> </bean>
Thanks in advance
Chris
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2011 04:56 AM
<property name="transactionsExternallyManaged" value="false" />
Not sure about this one.. When transactions aren't externally managed, activiti will handle it, and close connections as well…
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2011 02:27 PM
yes, i tried both, setting it to true and false. and i have the same issue.
i created a more detailed forum post here, which reflects the current
state of my problem with transactions.
i created a more detailed forum post here, which reflects the current
state of my problem with transactions.