Hi slogger,
we are getting close to what you want, but we are not there yet. We currently utilize two
different Hibernate configuration files for EJB3 Entities (via persistence.xml) and JBPM
(via jbpm.cfg.xml). When we tried to split up XA transaction enabled sessions with one
Hibernate configuration only, we ran into strange issues (eg. JBPM-Tables being created in
both schemas).
Here is a short summary of the configuration files are being used:
persistence.xml --> hibernate.ejb.cfg.xml
jbpm.cfg.xml --> hibernate.jbpm.cfg.xml
Here are the details for your reference:
persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
| <persistence
xmlns="http://java.sun.com/xml/ns/persistence"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| version="1.0"
|
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
| <persistence-unit name="VacationPU"
transaction-type="JTA">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>jdbc/VACATION_TEST</jta-data-source>
| <properties>
| <property name="hibernate.ejb.cfgfile"
value="hibernate.ejb.cfg.xml"/>
| </properties>
| </persistence-unit>
| </persistence>
jbpm.cfg.xml
<jbpm-configuration>
|
| <!--
| The default configurations can be found in org/jbpm/default.jbpm.cfg.xml
| Those configurations can be overwritten by putting this file called
| jbpm.cfg.xml on the root of the classpath and put in the customized values.
| -->
|
| <string name="resource.varmapping" value="jbpm.varmapping.xml"
/>
| <string name="resource.hibernate.cfg.xml"
value="hibernate.jbpm.cfg.xml" />
|
| <jbpm-context>
| <service name="persistence">
| <factory>
| <bean name="persistence.factory"
| class="org.jbpm.persistence.jta.JtaDbPersistenceServiceFactory">
|
| <field name="isTransactionEnabled">
| <false />
| </field>
|
| </bean>
| </factory>
| </service>
| <service name="tx" factory="org.jbpm.tx.TxServiceFactory"
/>
| </jbpm-context>
|
| </jbpm-configuration>
hibernate.ejb.cfg.xml
<?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">
|
|
| <hibernate-configuration>
| <session-factory>
| <property
name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
|
| <property
name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
|
| </session-factory>
| </hibernate-configuration>
hibernate.jbpm.cfg.xml (mappings left out):
<?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">
|
|
| <hibernate-configuration>
| <session-factory>
|
| <!-- hibernate dialect -->
| <property
name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
|
| <property
name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
|
| <!-- DataSource properties -->
| <property
name="hibernate.connection.datasource">jdbc/JBPM_DB</property>
| <!-- DataSource properties (end) -->
|
| <!-- JTA transaction properties -->
| <property
name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
| <property
name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.SunONETransactionManagerLookup</property>
| <!-- JTA transaction properties (end) -->
|
Any further hints or shared experience on the subject would be highly appreciated.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4058312#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...