<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
<table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tbody>
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tbody>
<tr>
<td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
<h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
<!-- To have a header image/logo replace the name below with your img tag -->
<!-- Email clients will render the images when the message is read so any image -->
<!-- must be made available on a public server, so that all recipients can load the image. -->
<a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Re: JBPM5 - How can I change the database?
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/rrpeterson">Ryan Peterson</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/627252#627252">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>I seem to have things working properly with mysql, I'll see if I can help (Running JBPM 5.1):</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>my Maven dependencies (this took a long time to find the correct versions that would work together, I borrowed heavily from some of the example projects):</p><table><tbody><tr><td style=";">    </td><td style=";"><dependency></td></tr><tr><td style=";">        </td><td style=";"><groupId>javax.servlet.jsp</groupId></td></tr><tr><td style=";">        </td><td style=";"><artifactId>jsp-api</artifactId></td></tr><tr><td style=";">    </td><td style=";"></dependency></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";">    </td><td style=";"><dependency></td></tr><tr><td style=";">        </td><td style=";"><groupId>org.springframework.security</groupId></td></tr><tr><td style=";">        </td><td style=";"><artifactId>spring-security-core</artifactId></td></tr><tr><td style=";">    </td><td style=";"></dependency></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";">    </td><td style=";"><dependency></td></tr><tr><td style=";">        </td><td style=";"><groupId>org.jbpm</groupId></td></tr><tr><td style=";">        </td><td style=";"><artifactId>jbpm-flow</artifactId></td></tr><tr><td style=";">    </td><td style=";"></dependency></td></tr><tr><td style=";">    </td><td style=";"><dependency></td></tr><tr><td style=";">        </td><td style=";"><groupId>org.jbpm</groupId></td></tr><tr><td style=";">        </td><td style=";"><artifactId>jbpm-bpmn2</artifactId></td></tr><tr><td style=";">    </td><td style=";"></dependency></td></tr><tr><td style=";">    </td><td style=";"><dependency></td></tr><tr><td style=";">        </td><td style=";"><groupId>org.jbpm</groupId></td></tr><tr><td style=";">        </td><td style=";"><artifactId>jbpm-flow-builder</artifactId></td></tr><tr><td style=";">    </td><td style=";"></dependency></td></tr><tr><td style=";">    </td><td style=";"><dependency></td></tr><tr><td style=";">        </td><td style=";"><groupId>org.jbpm</groupId></td></tr><tr><td style=";">        </td><td style=";"><artifactId>jbpm-persistence-jpa</artifactId></td></tr><tr><td style=";">    </td><td style=";"></dependency></td></tr><tr><td style=";">    </td><td style=";"><dependency></td></tr><tr><td style=";">        </td><td style=";"><groupId>com.google.code.gson</groupId></td></tr><tr><td style=";">        </td><td style=";"><artifactId>gson</artifactId></td></tr><tr><td style=";">    </td><td style=";"></dependency></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";">    </td><td style=";"><!-- Generic JPA Persistence --></td></tr><tr><td style=";">    </td><td style=";"><dependency></td></tr><tr><td style=";">        </td><td style=";"><groupId>javax.persistence</groupId></td></tr><tr><td style=";">        </td><td style=";"><artifactId>persistence-api</artifactId></td></tr><tr><td style=";">    </td><td style=";"></dependency></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";">    </td><td style=";"><!-- Transaction Management --></td></tr><tr><td style=";">    </td><td style=";"><dependency></td></tr><tr><td style=";">        </td><td style=";"><groupId>javax.transaction</groupId></td></tr><tr><td style=";">        </td><td style=";"><artifactId>jta</artifactId></td></tr><tr><td style=";">    </td><td style=";"></dependency></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";">    </td><td style=";"><dependency></td></tr><tr><td style=";">        </td><td style=";"><groupId>org.codehaus.btm</groupId></td></tr><tr><td style=";">        </td><td style=";"><artifactId>btm</artifactId></td></tr><tr><td style=";">    </td><td style=";"></dependency></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";">    </td><td style=";"><!-- Persistence Provider: Hibernate --></td></tr><tr><td style=";">    </td><td style=";"><dependency></td></tr><tr><td style=";">        </td><td style=";"><groupId>org.hibernate</groupId></td></tr><tr><td style=";">        </td><td style=";"><artifactId>hibernate-entitymanager</artifactId></td></tr><tr><td style=";">    </td><td style=";"></dependency></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";">    </td><td style=";"><dependency></td></tr><tr><td style=";">        </td><td style=";"><groupId>org.hibernate</groupId></td></tr><tr><td style=";">        </td><td style=";"><artifactId>hibernate-annotations</artifactId></td></tr><tr><td style=";">    </td><td style=";"></dependency></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";">    </td><td style=";"><dependency></td></tr><tr><td style=";">        </td><td style=";"><groupId>org.hibernate</groupId></td></tr><tr><td style=";">        </td><td style=";"><artifactId>hibernate-commons-annotations</artifactId></td></tr><tr><td style=";">    </td><td style=";"></dependency></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";">    </td><td style=";"><dependency></td></tr><tr><td style=";">        </td><td style=";"><groupId>org.hibernate</groupId></td></tr><tr><td style=";">        </td><td style=";"><artifactId>hibernate-core</artifactId></td></tr><tr><td style=";">    </td><td style=";"></dependency></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";">    </td><td style=";"><!-- Data Base: H2--></td></tr><tr><td style=";">    </td><td style=";"><dependency></td></tr><tr><td style=";">        </td><td style=";"><groupId>com.h2database</groupId></td></tr><tr><td style=";">        </td><td style=";"><artifactId>h2</artifactId></td></tr><tr><td style=";">    </td><td style=";"></dependency></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";">    </td><td style=";"><!-- Logging --></td></tr><tr><td style=";">    </td><td style=";"><dependency></td></tr><tr><td style=";">        </td><td style=";"><groupId>org.slf4j</groupId></td></tr><tr><td style=";">        </td><td style=";"><artifactId>slf4j-api</artifactId></td></tr><tr><td style=";">    </td><td style=";"></dependency></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";">    </td><td style=";"><!-- reporting --></td></tr><tr><td style=";">    </td><td style=";"><dependency></td></tr><tr><td style=";">        </td><td style=";"><groupId>org.jbpm</groupId></td></tr><tr><td style=";">        </td><td style=";"><artifactId>jbpm-bam</artifactId></td></tr><tr><td style=";">    </td><td style=";"></dependency></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>My persistence.xml:</p><p>  <persistence-unit name="org.jbpm.persistence.jpa"></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    <provider>org.hibernate.ejb.HibernatePersistence</provider></p><p>    <jta-data-source>jdbc/processInstanceDS</jta-data-source></p><p>    <class>org.drools.persistence.info.SessionInfo</class></p><p>    <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class></p><p>    <class>org.jbpm.persistence.processinstance.ProcessInstanceEventInfo</class></p><p>    <class>org.drools.persistence.info.WorkItemInfo</class></p><p>    <class>org.jbpm.process.audit.ProcessInstanceLog</class></p><p>    <class>org.jbpm.process.audit.NodeInstanceLog</class></p><p>    <class>org.jbpm.process.audit.VariableInstanceLog</class></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    <properties></p><p>      <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/></p><p>      <property name="hibernate.max_fetch_depth" value="3"/></p><p>      <property name="hibernate.hbm2ddl.auto" value="update"/></p><p>      <property name="hibernate.show_sql" value="true"/></p><p>      <property name="hibernate.transaction.manager_lookup_class"</p><p>                value="org.hibernate.transaction.BTMTransactionManagerLookup"/></p><p>    </properties></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  </persistence-unit></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>My unit test DB setup:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";"></td><td style=";">@BeforeTest</td></tr><tr><td style=";"></td><td style=";">public void setup() {</td></tr><tr><td style=";">    </td><td style=";">// setup a JNDI Datasource using Bitronix PoolingDataSource</td></tr><tr><td style=";">    </td><td style=";">ds = new PoolingDataSource();</td></tr><tr><td style=";">    </td><td style=";">ds.setUniqueName( "jdbc/processInstanceDS" );</td></tr><tr><td style=";">    </td><td style=";">ds.setClassName("com.mysql.jdbc.jdbc2.optional.MysqlXADataSource");</td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";">    </td><td style=";">ds.setMinPoolSize(0);</td></tr><tr><td style=";">    </td><td style=";">ds.setMaxPoolSize(3);</td></tr><tr><td style=";">    </td><td style=";">ds.setAllowLocalTransactions(true);</td></tr><tr><td style=";">    </td><td style=";">ds.getDriverProperties().put("user", "userName");</td></tr><tr><td style=";">    </td><td style=";">ds.getDriverProperties().put( "password", "userPassword" );</td></tr><tr><td style=";">    </td><td style=";">ds.getDriverProperties().put( "URL", "jdbc:mysql://localhost:3306/jbpm" );</td></tr><tr><td style=";">//    </td><td style=";">ds.getDriverProperties().put( "URL", "jdbc:h2:mem:mydb" );  // in-memory DB</td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><table><tbody><tr><td style=";">    </td><td style=";">ds.init();</td></tr><tr><td style=";"></td><td style=";">}</td></tr></tbody></table></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/627252#627252">going to Community</a></p>
<p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>