DB2 has its own set of database connection properties.  An example from our 
failover config is below.  Also, here's a link describing db2 properties: 
https://www.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_r0052038.html

  <Resource id="db" type="javax.sql.DataSource">
          jdbcDriver com.ibm.db2.jcc.DB2Driver
          JdbcUrl jdbc:db2://db01:30003/db
          connectionProperties = 
[loginTimeout=300;maxRetriesForClientReroute=2;connectionTimeout=300;clientRerouteAlternateServerName=db02;clientRerouteAlternatePortNumber=30003;retryIntervalForClientReroute=30;]
          UserName john
          Password doe
          maxActive 200
          maxWaitTime 15000
          minIdle 10
          validationQuery = select count(*) from custlogs.file_data
  </Resource>

-----Original Message-----
From: Romain Manni-Bucau [mailto:[email protected]] 
Sent: Tuesday, November 22, 2016 11:09 AM
To: [email protected]
Subject: Re: FailOver TomEE/Oracle

hello

is it the exact same url for websphere? did you check your datasource config 
throught jmx?


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog 
<https://blog-rmannibucau.rhcloud.com> | Old Blog 
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | 
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory 
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-11-22 17:05 GMT+01:00 Edouard LAMOTTE <[email protected]>:

> Hi,
>
>
> i'm facing a problem of reconnection with TomEE on Oracle Exadata.
>
>
> We have an application server TomEE 1.7.2 connected on Oracle Database 
> Exadata (two nodes active/passive).
>
>
> We are trying to test the automatic reconnection between tomEE and the 
> Database when the active node falls.
> When the first node falls, we start the second, but TomEE's datasource 
> can't establish a new connection without restarting the server.
>
> It works on IBM Websphere, we don't need to restart the server, it's 
> transparent for users. So we want to do the same with TomEE, But i 
> don't know if it can work with TomEE and DBCP.
>
>
> I use configuration parameters like testOnBorrow, validationQuery and 
> others as you can see below.
>
> Here my tomee.xml :
>
> <tomee>
> ...
>
> <Resource id="jdbc/xxxxx" type="javax.sql.DataSource">
>
> JdbcDriver=oracle.jdbc.OracleDriver
>
> JdbcUrl=jdbc:oracle:thin:@(DESCRIPTION=(FAILOVER=on)(
> ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=XXX1)(PORT=
> 1523))(ADDRESS=(PROTOCOL=TCP)(HOST=XXX2)(PORT=1523)))(
> CONNECT_DATA=(SERVICE_NAME=APP_XXXX)))
>
> UserName=XXX
> Password=XXX
>
> testWhileIdle=true
> testOnBorrow=true
> testOnReturn=true
> validationQuery=SELECT 1 FROM DUAL
> validationInterval=3
> timeBetweenEvictionRunsMillis=3
> maxActive=10
> minIdle=10
> maxWait=10
> initialSize=10
> removeAbandonedTimeout=5
> removeAbandoned=true
> logAbandoned=true
> minEvictableIdleTimeMillis=30000
>
> </Resource>
>
>
> </tomee>
>
>
> Any ideas/suggestions?
>
>
> Thanks for your help.
>
>
> Regards.
>
>
>
>

Reply via email to