-
1. Re: TaskService issue
saraswati.santanu Jan 14, 2010 2:55 PM (in response to tejjbpm)1 of 1 people found this helpfulIts not the responsibility of JBPM to manage connections. It must be hibernate which is opening the connection.
You need to explicitly close a connection if you are not using transaction manager, otherwise transaction manager pretty much does it for you.
If you are using a transaction manager then you might need to check why this particular task service call is executed outside a transaction.
If you are developing a JEE app and not using a transaction manager, then... best of luck
-
2. Re: TaskService issue
tejjbpm Jan 15, 2010 4:51 AM (in response to saraswati.santanu)Hi Santanu
Thanks for the reply.
I am using a transaction manager and it is my hiberate which is doing the talking with the database.
Here is my config. Do you see anything wrong with this? Do I have to declare any additional params for cleanup.. Actually I am using the default config which came with the installation and have not added anything extra..I also ran a test for all my other API calls and everything seem to have the same issue..so it is just not the task query..
Thanks in advance ..
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">>
<session-factory><hibernate-configuration
<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/mydb</property>
<property name="hibernate.connection.username">username</property>
<property name="hibernate.connection.password">password</property>
<property name="hibernate.format_sql">true</property><mapping resource="jbpm.repository.hbm.xml" />
<mapping resource="jbpm.execution.hbm.xml" />
<mapping resource="jbpm.history.hbm.xml" />
<mapping resource="jbpm.task.hbm.xml" />
<mapping resource="jbpm.identity.hbm.xml" /></session-factory>
</hibernate-configuration> -
3. Re: TaskService issue
saraswati.santanu Jan 15, 2010 7:18 AM (in response to tejjbpm)I believe, if you need to use jta transaction manager and data source in a server managed environment then this configuration is not good. You should not give db driver, db url etc to hibernate. They should be configured in the server. And the data source and tx manager configured in server should be provided to hibernate.
So instead of the following:
<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/mydb</property>
<property name="hibernate.connection.username">username</property>
<property name="hibernate.connection.password">password</property>you should be using something like:
<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<!--Provide the actual data source name you have configured here-->
<property name="connection.datasource">java:comp/jdbc/MySQLDataSource</property>
<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<!--Provide the actual tx manager name you have configured here-->
<property name="jta.UserTransaction">java:comp/UserTransaction</property>Give the actual datasource and tx manager JNDI name that you configured.
-
4. Re: TaskService issue
tejjbpm Jan 15, 2010 9:55 AM (in response to saraswati.santanu)Hi Santanu
Thanks a ton.
After making the changes you suggested it worked for me.