paulwong

          My Links

          Blog Stats

          常用鏈接

          留言簿(67)

          隨筆分類(1391)

          隨筆檔案(1149)

          文章分類(7)

          文章檔案(10)

          相冊

          收藏夾(2)

          AI

          Develop

          E-BOOK

          Other

          養生

          微服務

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          60天內閱讀排行

          JBPM的雙數據源配置

          JBPM數據源和業務數據源不是同一個的時候的配置:


          <!-- jta config -->
              
          <!-- 業務數據庫 -->
              
          <bean id="dataSource" class="com.atomikos.jdbc.AtomikosDataSourceBean"
                  init-method
          ="init" destroy-method="close">
                  
          <property name="uniqueResourceName">
                      
          <value>mysql/main</alue>
                  
          </property>
                  
          <property name="xaDataSourceClassName">
                      
          <value>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</alue>
                  
          </property>
                  
          <property name="xaProperties">
                      
          <props>
                          
          <prop key="URL">${jdbc.url}</prop>
                          
          <prop key="user">${jdbc.username}</prop>
                          
          <prop key="password">${jdbc.password}</prop>
                      
          </props>
                  
          </property>
                  
          <property name="maxPoolSize">
                      
          <value>3</alue>
                  
          </property>
                  
          <property name="testQuery">
                      
          <value>SELECT 1</alue>
                  
          </property>
              
          </bean>

              
          <!-- JBPM數據庫 -->
              
          <bean id="dataSourceJbpm"
                  class
          ="com.atomikos.jdbc.AtomikosDataSourceBean" init-method="init"
                  destroy-method
          ="close">
                  
          <property name="uniqueResourceName">
                      
          <value>mysql/news</alue>
                  
          </property>
                  
          <property name="xaDataSourceClassName">
                      
          <value>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</alue>
                  
          </property>
                  
          <property name="xaProperties">
                      
          <props>
                          
          <prop key="URL">${jbpm.jdbc.url}</prop>
                          
          <prop key="user">${jbpm.jdbc.username}</prop>
                          
          <prop key="password">${jbpm.jdbc.password}</prop>
                      
          </props>
                  
          </property>
                  
          <property name="maxPoolSize">
                      
          <value>3</alue>
                  
          </property>
                  
          <property name="testQuery">
                      
          <value>SELECT 1</alue>
                  
          </property>
              
          </bean>

              
          <bean id="lobHandler"
                  class
          ="org.springframework.jdbc.support.lob.DefaultLobHandler" />

              
          <!-- 業務數據庫的sqlMapClient -->
              
          <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
                  
          <property name="configLocation" value="classpath:SqlMapConfig.xml" />
                  
          <property name="dataSource" ref="dataSource" />
                  
          <property name="lobHandler" ref="lobHandler" />
              
          </bean>

              
          <!-- Construct Atomikos UserTransactionManager, needed to configure Spring -->
              
          <bean id="atomikosTransactionManager"
                  class
          ="com.atomikos.icatch.jta.UserTransactionManager"
                  init-method
          ="init" destroy-method="close">
                  
          <!--  when close is called, should we force transactions to terminate or not? -->
                  
          <property name="forceShutdown">
                      
          <value>true</alue>
                  
          </property>
              
          </bean>

              
          <!-- Also use Atomikos UserTransactionImp, needed to configure Spring  -->
              
          <bean id="atomikosUserTransaction"
                  class
          ="com.atomikos.icatch.jta.UserTransactionImp">
                  
          <property name="transactionTimeout" value="300" />
              
          </bean>

              
          <!-- Configure the Spring framework to use JTA transactions from Atomikos -->
              
          <bean id="transactionManager"
                  class
          ="org.springframework.transaction.jta.JtaTransactionManager">
                  
          <property name="transactionManager" ref="atomikosTransactionManager"/>
                  
          <property name="userTransaction" ref="atomikosUserTransaction"/>
              
          </bean>
              
              
          <tx:advice id="txAdvice" transaction-manager="transactionManager">
                  
          <tx:attributes>
                      
          <tx:method name="find*" propagation="REQUIRED" read-only="true" rollback-for="ServiceException"/>
                      
          <tx:method name="get*" propagation="REQUIRED" read-only="true" rollback-for="ServiceException"/>
                      
          <tx:method name="list*" propagation="REQUIRED" read-only="true" rollback-for="ServiceException"/>
                      
          <tx:method name="*" propagation="REQUIRED" rollback-for="ServiceException"/>
                  
          < :attributes>
              
          < :advice>

              
          <aop:config>
                  
          <aop:advisor pointcut="execution(* com.service.impl.*.*(..))" advice-ref="txAdvice" />
              
          </aop:config>
              
              
          <!-- JBPM集成配置 -->
              
          <bean id="sessionFactoryForJbpm"
                  class
          ="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
                  
          <property name="mappingJarLocations">
                      
          <list>
                      
          <!-- hibernate 映射文件所在的jar包路徑 -->
                          
          <value>WEB-INF b/jbpm-jpdl.jar</alue>
                      
          < st>
                  
          </property>
                  
          <property name="hibernateProperties">
                      
          <props>
                          
          <prop key="hibernate.dialect">
                              org.hibernate.dialect.MySQL5Dialect
                          
          </prop>
                          
          <prop key="hibernate.show_sql">true</prop>
                          
          <prop key="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</prop>
                      
          </props>
                  
          </property>
                  
          <property name="dataSource" ref="dataSourceJbpm" />
              
          </bean>

              
          <bean id="jbpmConfiguration"
                  class
          ="org.springmodules.workflow.jbpm31.LocalJbpmConfigurationFactoryBean">
                  
          <property name="sessionFactory" ref="sessionFactoryForJbpm" />
                  
          <!-- jbpm.cfg.xml 配置JBPM的參數,如郵件服務器地址等,保持默認即可-->
                  
          <property name="configuration" value="classpath:jbpm.cfg.xml" />
                  
          <property name="createSchema" value="false" />
              
          </bean>

              
          <bean id="jbpmTemplate"
                  class
          ="com.ideal.common.util.JbpmUtils">
                  
          <constructor-arg index="0" ref="jbpmConfiguration" />
              
          </bean>
              
          <!-- END OF JBPM集成配置 --> 

          posted on 2009-03-11 09:34 paulwong 閱讀(1273) 評論(0)  編輯  收藏 所屬分類: JBPM

          主站蜘蛛池模板: 建平县| 齐齐哈尔市| 池州市| 山阴县| 大兴区| 民乐县| 平江县| 扎鲁特旗| 浑源县| 咸阳市| 常宁市| 广河县| 龙南县| 定边县| 屯门区| 宁河县| 建湖县| 尉氏县| 武宁县| 资阳市| 安仁县| 柘城县| 安西县| 望城县| 赣州市| 额尔古纳市| 恩施市| 拜泉县| 牙克石市| 城口县| 秭归县| 石景山区| 定南县| 彝良县| 桦川县| 石首市| 彭州市| 玉林市| 阿巴嘎旗| 平湖市| 宁海县|