JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Java Application Framework » Spring  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to postflat modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 兩個以上的 datasource 的 transactionManager 要怎麼設定
Fiona5413





發文: 2
積分: 0
於 2012-02-16 18:42 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<description>使用 Spring 自備的 data source (for development time, especially unit testing)</description>
<property name="driverClassName" value="${dataSource.driverClassName}"/>
<property name="url" value="${dataSource.url}"/>
<property name="initialSize" value="${dataSource.initialSize}"/>
<property name="maxActive" value="${dataSource.maxActive}"/>
<property name="username" value="${dataSource.username}"/>
<property name="password" value="${dataSource.password}"/>
<property name="validationQuery" value="select 1"/>
</bean>

<!-- a PlatformTransactionManager is still required -->
<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  <!-- (this dependency is defined somewhere else) -->
  <property name="dataSource" ref="dataSource"/>
</bean>

<!-- enable the configuration of transactional behavior based on annotations -->
<tx:annotation-driven transaction-manager="txManager"/>

<bean class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close" id="ivrDataSource">
    <description>IVR data source</description>
    <property name="driverClassName" value="${ivrDataSource.driverClassName}" />
    <property name="url" value="${ivrDataSource.url}" />
    <property name="initialSize" value="${ivrDataSource.initialSize}" />
    <property name="maxActive" value="${ivrDataSource.maxActive}" />
    <property name="username" value="${ivrDataSource.username}" />
    <property name="password" value="${ivrDataSource.password}" />
  </bean>
<bean id="IVRtxManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  <property name="dataSource" ref="ivrDataSource"/>
</bean>
<tx:annotation-driven transaction-manager="IVRtxManager"/>

結果不能執行
請問正確寫法應該如何?
請高手指正,謝謝


reply to postreply to post
話題樹型展開
人氣 標題 作者 字數 發文時間
1024 兩個以上的 datasource 的 transactionManager 要怎麼設定 Fiona5413 1995 2012-02-16 18:42
» JWorld@TW »  Java Application Framework » Spring

reply to postflat modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8