[jboss-user] [jBPM] - Re: JBPM5, Spring, BTM and Tomcat

snyperboss do-not-reply at jboss.com
Mon Nov 28 07:50:06 EST 2011


snyperboss [http://community.jboss.org/people/snyperboss] created the discussion

"Re: JBPM5, Spring, BTM and Tomcat"

To view the discussion, visit: http://community.jboss.org/message/638630#638630

--------------------------------------------------------------
Hi All,

I could Integrate this using spring in a single bean defenition file.

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> 





    <bean id="basicdataSource" class="org.apache.commons.dbcp.BasicDataSource"> 
        <property name="driverClassName"> 
            <value>com.mysql.jdbc.Driver</value> 
        </property> 
        <property name="url"> 
            <value>jdbc:mysql://localhost:3306/test</value> 
        </property> 
        <property name="username"> 
            <value>root</value> 
        </property> 
        <property name="password"> 
            <value>qaz at 12345</value> 
        </property> 
    </bean> 
    <bean id="xadataSource" class="bitronix.tm.resource.jdbc.PoolingDataSource" 
        init-method="init" destroy-method="close"> 
        <property name="className" 
            value="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource" /> 
        <property name="uniqueName" value="jdbc/testDS1" /> 
        <property name="minPoolSize" value="1" /> 
        <property name="maxPoolSize" value="5" /> 
        <property name="allowLocalTransactions" value="true" /> 
        <property name="driverProperties"> 
            <props> 
                <prop key="URL">jdbc:mysql://localhost:3306/test</prop> 
                <prop key="user">root</prop> 
                <prop key="password">qaz at 12345</prop> 
            </props> 
        </property> 
    </bean> 


    <bean id="txManager" 
        class="org.springframework.transaction.jta.JtaTransactionManager"> 
        <property name="transactionManager" ref="bitronixTransactionManager" /> 
        <property name="userTransaction" ref="bitronixTransactionManager" /> 
    </bean> 

    <bean id="bitronixTransactionManager" factory-method="getTransactionManager" 
        class="bitronix.tm.TransactionManagerServices" depends-on="xadataSource,txManager" 
        destroy-method="shutdown" /> 



    <bean id="entityManagerFactoryJbpmPersistanceJpa" 
        class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> 
        <property name="dataSource" ref="xadataSource" /> 
        <property name="persistenceUnitName" value="org.jbpm.persistence.jpa" /> 
        <property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml" /> 
        <property name="jpaVendorAdapter"> 
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> 
                <!-- 
                    <property name="databasePlatform" 
                    value="org.hibernate.dialect.MySQLDialect" /> 
                --> 
                <property name="databasePlatform" value="org.hibernate.dialect.SybaseDialect" /> 
                <property name="showSql" value="true" /> 
                <property name="generateDdl" value="false" /> 
            </bean> 
        </property> 
    </bean> 

    <bean id="entityManagerFactoryJbpmTask" 
        class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> 
        <property name="dataSource" ref="basicdataSource" /> 
        <property name="persistenceUnitName" value="org.jbpm.task" /> 
        <property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml" /> 
        <property name="jpaVendorAdapter"> 
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> 
                <!-- 
                    <property name="databasePlatform" 
                    value="org.hibernate.dialect.MySQLDialect" /> 
                --> 
                <property name="databasePlatform" value="org.hibernate.dialect.SybaseDialect" /> 
                <property name="showSql" value="true" /> 
                <property name="generateDdl" value="false" /> 

            </bean> 
        </property> 
    </bean> 



    <bean id="testInsertDAO" class="com.sample.TestInsertDAO"> 
        <property name="dataSource" ref="basicdataSource" /> 
    </bean> 



</beans> 



Thanks!
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/638630#638630]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111128/bf842690/attachment-0001.html 


More information about the jboss-user mailing list