WebSphere V6におけるS2のコネクションプール設定 | Go The Distance

WebSphere V6におけるS2のコネクションプール設定

どこを探してもWAS6.0用の設定はありませんでしたので、このブログに書いてある設定が世に出る最初のものかもしれません。もしかしたらGoogleで「WAS6 Seaser コネクションプール」で検索したらトップに来ちゃうかも?


WebSphere V6用のj2ee.diconの設定を記載しておきます。参考になれば幸いです。


-------------------------------------------------------------------

<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE components PUBLIC "-//SEASAR2.1//DTD S2Container//EN"
"http://www.seasar.org/dtd/components21.dtd ">
<components namespace="j2ee">
<component name="requiredTx"
class="org.seasar.extension.tx.RequiredInterceptor" />
<component name="requiresNewTx"
class="org.seasar.extension.tx.RequiresNewInterceptor" />
<component name="mandatoryTx"
class="org.seasar.extension.tx.MandatoryInterceptor" />
<!-- WAS 6.0 -->
<component name="initialContext" class="javax.naming.InitialContext"/>
<component name="transactionManager"
class="org.seasar.extension.j2ee.SingletonTransactionManager">
<arg>"com.ibm.ws.Transaction.TransactionManagerFactory"</arg>
<arg>"getTransactionManager"</arg>
</component>
<component name="dataSource" class="org.seasar.extension.j2ee.JndiDataSource">
<arg>initialContext</arg>
<arg>"jdbc/AppDS"</arg>
</component>

<component name="poolManager"
class="jp.co.***.PooLManager">
<arg>dataSource</arg>
</component>
</components>

-------------------------------------------------------------------------------


ポイントは3つ。


① S2のトランザクション管理クラスは当然書かない。


② WAS6では「com.ibm.ws.Transaction.TransactionManagerFactory」クラスがトランザクション管理クラスになっている。


③ 取得したdataSourceを引数にしてgetConnectionするために、コネクション管理クラスにDIで渡している。


以上です。これで実際動いてますんで、ご参考までに!