[jboss-user] [JBoss jBPM] - Re: Problem with my jbpm database

dleerob do-not-reply at jboss.com
Thu Dec 6 04:58:01 EST 2007


I have the a similair problem, where my MySQL connection seems to die with a socket connection error. I am going to try the following:

In hibernate.cfg.xml file, use:
<property name="hibernate.connection.datasource">java:comp/env/jdbc/JbpmDS</property>
  |  instead of the direct jdbc connection.

In my webapps context.xml which should be found in tomcat\conf\Catalina\localhost\[myappname].xml file, use something like:
<Resource name="jdbc/JbpmDS" auth="Container" type="javax.sql.DataSource"/>
  |     <ResourceParams name="jdbc/JbpmDS">
  |         <parameter>
  |             <name>factory</name>
  |             <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
  |         </parameter>
  |         <parameter>
  |             <name>maxActive</name>
  |             <value>100</value>
  |         </parameter>
  |         <parameter>
  |             <name>maxIdle</name>
  |             <value>30</value>
  |         </parameter>
  |         <parameter>
  |             <name>maxWait</name>
  |             <value>10000</value>
  |         </parameter>
  |         <parameter>
  |             <name>username</name>
  |             <value>jbossjbpm</value>
  |         </parameter>
  |         <parameter>
  |             <name>password</name>
  |             <value>jbossjbpm</value>
  |         </parameter>
  |         <parameter>
  |             <name>driverClassName</name>
  |             <value>com.mysql.jdbc.Driver</value>
  |         </parameter>
  |         <parameter>
  |             <name>defaultAutoCommit</name>
  |             <value>true</value>
  |         </parameter>
  |         <parameter>
  |             <name>url</name>
  |             <value>jdbc:mysql://localhost/jbpm321</value>
  |         </parameter>
  |         <parameter>
  |             <name>removeAbandoned</name>
  |             <value>true</value>
  |         </parameter>
  |         <parameter>
  |             <name>removeAbandonedTimeout</name>
  |             <value>60</value>
  |         </parameter>
  |         <parameter>
  |             <name>logAbandoned</name>
  |             <value>true</value>
  |         </parameter>
  |     </ResourceParams>
  | 

I'm hoping the maxIdle parameter will do the trick.
You could lower the maxIdle value if need be.

Or, you could look at using hibernate.c3p0.timeout property in hibernate.cfg.xml, instead of using the above method, but I think you may then need to go and get some extra hibernate jar files or something.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110775#4110775

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110775



More information about the jboss-user mailing list