Este conteúdo não está disponível no idioma selecionado.
2.5. Configuring a Datasource for JBoss Enterprise Web Server
The default configurations use embedded databases that are not suitable or supported for production environments. Before deploying into a production environment, this configuration must be changed to a supported database. JBoss Enterprise Web Server users must configure
jbpm-human-task.war and business-central-server.war.
The following example uses a MySQL database.
Procedure 2.3. Configuring a datasource for JBoss Enterprise Web Server
- Copy the MySQL driver to
tomcat6/lib/ - Configure the datasource resources in
tomcat6/conf/context.xml:<Resource name="jdbc/jbpmDS" auth="Container" type="javax.sql.DataSource" factory="bitronix.tm.resource.ResourceObjectFactory" uniqueName="jdbc/jbpmDS"/> <Resource name="jdbc/jbpmTasksDS" auth="Container" type="javax.sql.DataSource" factory="bitronix.tm.resource.ResourceObjectFactory" uniqueName="jdbc/jbpmTasksDS"/>
<Resource name="jdbc/jbpmDS" auth="Container" type="javax.sql.DataSource" factory="bitronix.tm.resource.ResourceObjectFactory" uniqueName="jdbc/jbpmDS"/> <Resource name="jdbc/jbpmTasksDS" auth="Container" type="javax.sql.DataSource" factory="bitronix.tm.resource.ResourceObjectFactory" uniqueName="jdbc/jbpmTasksDS"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Edit the
tomcat6/webapps/business-central-server.war/WEB-INF/Classes/META-INF/persistence.xmlfile to include the unique name fromcontext.xml:<jta-data-source>java:/comp/env/jdbc/jbpmDS</jta-data-source> ... <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />
<jta-data-source>java:/comp/env/jdbc/jbpmDS</jta-data-source> ... <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Edit the
tomcat6/webapps/jbpm-human-task.war/WEB-INF/classes/META-INF/persistence.xmlfile to include the unique name fromcontext.xml:<jta-data-source>java:/comp/env/jdbc/jbpmTasksDS</jta-data-source> ... <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />
<jta-data-source>java:/comp/env/jdbc/jbpmTasksDS</jta-data-source> ... <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" />Copy to Clipboard Copied! Toggle word wrap Toggle overflow - JBoss Enterprise Web Server does not include a transaction manager. The following example shows the configuration for Bitronix, and it is provided for evaluation purposes only. Bitronix can be downloaded from http://docs.codehaus.org/display/BTM/Home.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - To configure the Bitronix transaction manager, create a
tomcat6/conf/btm-config.propertiesfile:bitronix.tm.serverId=tomcat-btm-node0 bitronix.tm.journal.disk.logPart1Filename=${btm.root}/work/btm1.tlog bitronix.tm.journal.disk.logPart2Filename=${btm.root}/work/btm2.tlog bitronix.tm.resource.configuration=${btm.root}/conf/resources.propertiesbitronix.tm.serverId=tomcat-btm-node0 bitronix.tm.journal.disk.logPart1Filename=${btm.root}/work/btm1.tlog bitronix.tm.journal.disk.logPart2Filename=${btm.root}/work/btm2.tlog bitronix.tm.resource.configuration=${btm.root}/conf/resources.propertiesCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the following line totomcat6/conf/context.xml:<Transaction factory="bitronix.tm.BitronixUserTransactionObjectFactory"/>
<Transaction factory="bitronix.tm.BitronixUserTransactionObjectFactory"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the following line totomcat6/conf/server.xml<Listener className="bitronix.tm.integration.tomcat55.BTMLifecycleListener"/>
<Listener className="bitronix.tm.integration.tomcat55.BTMLifecycleListener"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a configuration properties file. On unix based systems the file should betomcat6/setenv.sh, and on Windows systems the file should betomcat6/setenv.bat.CATALINA_OPTS="-Dbtm.root=$CATALINA_HOME -Dbitronix.tm.configuration=$CATALINA_HOME/conf/btm-config.properties"
CATALINA_OPTS="-Dbtm.root=$CATALINA_HOME -Dbitronix.tm.configuration=$CATALINA_HOME/conf/btm-config.properties"Copy to Clipboard Copied! Toggle word wrap Toggle overflow