Junjao

Programming, Software Engineering

jboss multidatasource ธันวาคม 25, 2011

Filed under: Uncategorized — จั่น @ 2:26 am

ในไฟล์  XX-ds.xml ที่ deploy ลงใน  <server_instance_name>/deploy/…

 

    <connection-url>jdbc:mysql://localhost:3306/test|jdbc:mysql://172.20.14.106:3306/test</connection-url>
    <url-delimiter>|</url-delimiter>

ระหว่างที่ database แรก ล่มแล้วย้ายไปสร้าง connection กับ database ตัวที่สอง จะมีการล่มเกิดขึ้น ดังนั้นก่อนที่ application จะได้ connection ไปจึงต้องมีการ check ก่อนว่า connection นั้นใช้ได้หรือไม่ ด้วย tag

   <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>

 

**อ้างอิง http://jagadesh4java.blogspot.com/2011/09/jboss-database-failover-high.html

 

ใส่ความเห็น

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / เปลี่ยนแปลง )

Twitter picture

You are commenting using your Twitter account. Log Out / เปลี่ยนแปลง )

Facebook photo

You are commenting using your Facebook account. Log Out / เปลี่ยนแปลง )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.