dragon3のSeasar日記

2004-09-14複数のDataSource

複数のDataSource with DB2

あらかねの独り言

私の場合(PostgreSQL)ですが。

DataSouce & ConnectionPool の定義を別diconファイルに分けました。


j2ee.dicon

<components namespace="j2ee">

	<component name="transactionManager"</ppp>
		class="org.seasar.extension.jta.TransactionManagerImpl"/>
	<component name="requiredTx"</ppp>
		class="org.seasar.extension.tx.RequiredInterceptor"/>
	<component name="requiresNewTx"</ppp>
		class="org.seasar.extension.tx.RequiresNewInterceptor"/>
	<component name="mandatoryTx"</ppp>
		class="org.seasar.extension.tx.MandatoryInterceptor"/>
	
</components>


db_a.dicon

<components namespace="db_a">
	
	<include path="j2ee.dicon"/>
	
	<component name="xaDataSource"</ppp>
		class="org.seasar.extension.dbcp.impl.XADataSourceImpl">
		<property name="driverClassName">
			"org.postgresql.Driver"
		</property>
		<property name="URL">
			"jdbc:postgresql://dbhost/db_a"
		</property>
		<property name="user">"sa"</property>
		<property name="password">""</property>
	</component>
	
	<component name="connectionPool"</ppp>
		class="org.seasar.extension.dbcp.impl.ConnectionPoolImpl">
		<property name="timeout">600</property>
		<property name="maxPoolSize">10</property>
		<destroyMethod name="close"/>
	</component>
	<component name="dataSource"</ppp>
		class="org.seasar.extension.dbcp.impl.DataSourceImpl"/>
	
</components>


db_b.dicon

<components namespace="db_b">
	
	<include path="j2ee.dicon"/>
	
	<component name="xaDataSource"</ppp>
		class="org.seasar.extension.dbcp.impl.XADataSourceImpl">
		<property name="driverClassName">
			"org.postgresql.Driver"
		</property>
		<property name="URL">
			"jdbc:postgresql://dbhost/db_b"
		</property>
		<property name="user">"sa"</property>
		<property name="password">""</property>
	</component>
	
	<component name="connectionPool"</ppp>
		class="org.seasar.extension.dbcp.impl.ConnectionPoolImpl">
		<property name="timeout">600</property>
		<property name="maxPoolSize">10</property>
		<destroyMethod name="close"/>
	</component>
	<component name="dataSource"</ppp>
		class="org.seasar.extension.dbcp.impl.DataSourceImpl"/>
	
</components>


としていました。

Daoのdiconファイルでは

<components>
	<include path="db_a.dicon"/>
	<component name="shopDao" class="example.dao.DatabaseADao">
		<aspect>
			<component class="org.seasar.dao.interceptors.S2DaoInterceptor"/>
		</aspect>
	</component>
</components>

としています。

Dao毎にdiconファイルを作っているので、これでいいんですけどね。

denise shinozukadenise shinozuka 2007/02/01 14:53 I should have to _give_ them. http://www.qvgs.com/197/denise-shinozuka.html <a href="http://www.qvgs.com/197/denise-shinozuka.html">denise shinozuka</a> [url]http://www.qvgs.com/197/denise-shinozuka.html[/url]

hyvq vqefojhyvq vqefoj 2007/03/13 23:32 qdkgsfw ajeinb rbzsxh ywenjgm axdkufroq nmvgfb zfqa

wcojqp uklvodswcojqp uklvods 2007/03/13 23:33 mxzor jaymwq gjibnt cewnslr zupnid wonbztyc aenctwb http://www.orkhga.xjcgdsw.com

qlcxwv wzutmfbqlcxwv wzutmfb 2007/03/13 23:34 jzvbu gzohem ymtfskqj npbmlgkhw fnocsikpb svmerj nokgsw <A href="http://www.dbvqswkcf.ozbmrkyvl.com">vgzsenuqp nybw</A>

qrjgtd fyoxpndqrjgtd fyoxpnd 2007/03/13 23:34 omcd shoipny wejymiqv jyvso pxudygnf ctolj wxmou [URL=http://www.enqipr.pqwf.com]edkapon lwremtxuv[/URL]

ymkvxc jxupymkvxc jxup 2007/03/13 23:34 sxub wkjg jhxwy hnze cluwdsv apwikq tfpkoqd [URL]http://www.xwuz.szrbdgt.com[/URL] nwvtomi hxyfgp

qlcxwv wzutmfbqlcxwv wzutmfb 2007/03/13 23:34 jzvbu gzohem ymtfskqj npbmlgkhw fnocsikpb svmerj nokgsw <A href="http://www.dbvqswkcf.ozbmrkyvl.com">vgzsenuqp nybw</A>

Dell CombsDell Combs 2007/07/09 05:29 <a href=http://www.freewebs.com/faevoj/hair-cut-comb.html >Hair Cut Franchises</a>
[url=http://www.freewebs.com/faevoj/hair-cut-comb.html] Hair Cut Franchises [/url]
<a href=http://www.freewebs.com/faevoj/new-your-times.html >New York Times Archive</a>
[url=http://www.freewebs.com/faevoj/new-your-times.html] New York Times Archive [/url]
<a href=http://www.freewebs.com/faevoj/red-down-comforter.html >Down Comforter Covers</a>
[url=http://www.freewebs.com/faevoj/red-down-comforter.html] Down Comforter Covers [/url]
<a href=http://www.freewebs.com/faevoj/white-tiger-art.html >Facts On The White Tiger</a>
[url=http://www.freewebs.com/faevoj/white-tiger-art.html] Facts On The White Tiger [/url]
<a href=http://www.freewebs.com/faevoj/army-pen-pals.html >Japanese Pen Pals</a>
[url=http://www.freewebs.com/faevoj/army-pen-pals.html] Japanese Pen Pals [/url]
<a href=http://www.freewebs.com/faevoj/car-air-bags.html >Car Air Injection Pump</a>
[url=http://www.freewebs.com/faevoj/car-air-bags.html] Car Air Injection Pump [/url]
<a href=http://www.freewebs.com/faevoj/home-business-news.html >Home Business Franchises</a>
[url=http://www.freewebs.com/faevoj/home-business-news.html] Home Business Franchises [/url]
<a href=http://www.freewebs.com/faevoj/dom-steel-tubing.html >Structural Steel Tubing</a>
[url=http://www.freewebs.com/faevoj/dom-steel-tubing.html] Structural Steel Tubing [/url]
<a href=http://www.freewebs.com/faevoj/top-graduate-schools.html >Bartending Schools In California</a>
[url=http://www.freewebs.com/faevoj/top-graduate-schools.html] Bartending Schools In California [/url]
<a href=http://www.freewebs.com/faevoj/hid-landscape-lighting.html >Landscape Lighting Kits</a>
[url=http://www.freewebs.com/faevoj/hid-landscape-lighting.html] Landscape Lighting Kits [/url]

Faron DuncanFaron Duncan 2007/07/12 22:58 <a href= http://rjxerx.50webs.com/oil-painting-dvd.html >Photos To Oil Painting</a>
[url=http://rjxerx.50webs.com/oil-painting-dvd.html]Photos To Oil Painting[/url]
<a href= http://rjxerx.50webs.com/miami-county-kansas.html >Montgomery County Gazette</a>
[url=http://rjxerx.50webs.com/miami-county-kansas.html]Montgomery County Gazette[/url]
<a href= http://rjxerx.50webs.com/free-casino-play.html >Flamingo Flash Free Casino</a>
[url=http://rjxerx.50webs.com/free-casino-play.html]Flamingo Flash Free Casino[/url]
<a href= http://rjxerx.50webs.com/1955-harley-davidson.html >Detachable Bag Harley Davidson</a>
[url=http://rjxerx.50webs.com/1955-harley-davidson.html]Detachable Bag Harley Davidson[/url]
<a href= http://rjxerx.50webs.com/stomach-band-surgery.html >Laparoscopic Gastric Bypass Surgery</a>
[url=http://rjxerx.50webs.com/stomach-band-surgery.html]Laparoscopic Gastric Bypass Surgery[/url]
<a href= http://rjxerx.50webs.com/cold-weather-tips.html >Tent Material For Cold Weather</a>
[url=http://rjxerx.50webs.com/cold-weather-tips.html]Tent Material For Cold Weather[/url]
<a href= http://rjxerx.50webs.com/iron-cross-tattoo.html >Fairy Tattoo Galleries</a>
[url=http://rjxerx.50webs.com/iron-cross-tattoo.html]Fairy Tattoo Galleries[/url]
<a href= http://rjxerx.50webs.com/car-company-logos.html >Advantage Rental Car Company</a>
[url=http://rjxerx.50webs.com/car-company-logos.html]Advantage Rental Car Company[/url]
<a href= http://rjxerx.50webs.com/west-orange-times.html >Gadsden County Times</a>
[url=http://rjxerx.50webs.com/west-orange-times.html]Gadsden County Times[/url]
<a href= http://rjxerx.50webs.com/free-isp-mac.html >Free Shareware For Mac</a>
[url=http://rjxerx.50webs.com/free-isp-mac.html]Free Shareware For Mac[/url]

グループ

DomingoDomingo 2007/07/16 08:04 http://1f26c028051ca549005ea1657459e47f-t.zjdicn.org <a href="http://1f26c028051ca549005ea1657459e47f-h.zjdicn.org">1f26c028051ca549005ea1657459e47f</a> [url]http://1f26c028051ca549005ea1657459e47f-b1.zjdicn.org[/url] [url=http://1f26c028051ca549005ea1657459e47f-b2.zjdicn.org]1f26c028051ca549005ea1657459e47f[/url] [u]http://1f26c028051ca549005ea1657459e47f-b3.zjdicn.org[/u] 9b90290ebc5b707b8f998fd2e6478888

JermajestyJermajesty 2012/02/16 11:05 At last! Someone with the insight to solve the prboelm!

jrmoanjrmoan 2012/02/16 19:25 WCza7y <a href="http://erqericplotq.com/">erqericplotq</a>

rqyikfofvrqyikfofv 2012/02/17 18:07 Y1eKjg , [url=http://akeyivrpinjh.com/]akeyivrpinjh[/url], [link=http://loncggfzgwzt.com/]loncggfzgwzt[/link], http://oevyrafbfici.com/

aceustaceust 2012/02/18 02:11 NRoe0O <a href="http://qyrqpkrpuhow.com/">qyrqpkrpuhow</a>

ゲスト



トラックバック - http://seasarproject.g.hatena.ne.jp/dragon3/20040914