Hi Chris,
here is how I'm connecting to the database.
<Resource name="jdbc/DS"
auth="Container"
type="javax.sql.DataSource"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
testWhileIdle="true"
testOnBorrow="true"
testOnReturn="false"
validationQuery="SELECT 1"
validationInterval="30000"
timeBetweenEvictionRunsMillis="30000"
maxActive="100"
minIdle="10"
maxWait="10000"
initialSize="10"
removeAbandonedTimeout="60"
removeAbandoned="true"
logAbandoned="true"
minEvictableIdleTimeMillis="300000"
jmxEnabled="true"
jdbcInterceptors="ConnectionState;StatementFinalizer;ResetAbandonedTimer"
username="db1"
password="db1"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://db1.local/db1?useServerPrepStmts=false&useOldAliasMetadataBehavior=true"/>
Thanks
Niranjan
On Tue, Jun 14, 2016 at 3:41 PM, Christopher Schultz <
[email protected]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Niranjan,
>
> On 6/10/16 11:45 AM, Niranjan Babu Bommu wrote:
> > I have an issue with tomcat dns cache ttl, where if I change the IP
> > address of the database, tomcat still sending connection requests
> > to an old IP until I restart tomcat, this is not the case with
> > Jboss. I verified in java security, this what we have in java.
> >
> > #networkaddress.cache.ttl=-1
> >
> > since this property has been disabled, by default ttl will be 30
> > sec, jboss 7 is respecting this value, but not tomcat.
> >
> > so far I have tried these things in tomcat.
> >
> > https://bz.apache.org/bugzilla/show_bug.cgi?id=33226
> >
> > neither of these settings is not working in tomcat
> >
> > -Dnetworkaddress.cache.ttl=0 or -Dsun.net.inetaddr.ttl=0
> >
> >
> > java version "1.7.0_60" tomcat-7.0.56 os centos 6.
> >
> > can someone please help me out to fix this issue?
>
> How are you connecting to your database?
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iEYEARECAAYFAldgXeoACgkQ9CaO5/Lv0PAsAQCgv1QJp55fv8v1VIYXIGLzWWLn
> M6wAniY7ewMkxz5ogyIqg4PybnFtYBtV
> =TdRc
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
*Thanks*
*Niranjan*