TomcatExpert

Tomcat-jdbc pooling not detecting dead connections

We recently migrated to using the apache tomcat jdbc connection pooling.

We are using v1.1.0.1 of the connection pooling mechanism with tomcat 6.0.33 on Oracle 10g

Our connection pools are configured as follows:

<Resource name="jdbc/testPool" auth="Container"
              type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
          factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
          url="jdbc:oracle:thin:@192.168.1.11:1521:TESTDB"
              username="user" password="xxx" initialSize="2" maxActive="5" minIdle="1" maxIdle="2"
              maxWait="1" removeAbandoned="true" removeAbandonedTimeout="15"  logAbandoned="true"    abandonWhenPercentageFull="100"  jdbcInterceptors="ResetAbandonedTimer"/>

The application works fine in normal situations but we noticed the following problems:-

a) When the ResetAbandonedTimer kicks in the connection itself does not get discarded and the app when it requests a new connection gets handed the connection that was already killed by the ResetAbandonedTimer mechanism .

b) We were also able to easily reproduce the above issue by running the application and then killing the idle connection from the oracle end. I would expect that if a connection gets killed from the oracle end the connection pool should detect it and log and discard the connection. However the apache-tomcat-jdbc pooling mechanism as configured in my setup does not seem to detect this condition at all. It waits silently till the app requests another connection and returns the dead connection to the app which of course fails as soon as the app tries to use the connection.

asked by san9jay

question

add

testOnBorrow="true"

validationQuery="select 1 from dual"

in order to validate your connections

answer

answered by fhanik on May 10, 2012 08:39 AM

Filip Hanik is a Senior Software Engineer for the SpringSource Division of VMware, Inc. (NYSE: VMW) and a key participant in the company's Apache Tomcat initiatives. Filip brings 15 years of extensive experience in architecture, design and development of distributed application frameworks and containers and is recognized for his top-quality system development skills and continuous participation of Open Source development projects. Filip is an Apache Software Foundation member and a committer to the Apache Tomcat project where he is a leading authority on Tomcat clustering and a key contributor to the core of the platform. Filip has made contributions to software initiatives for Walmart.com, Sony Music, France Telecom and has held a variety of senior software engineering positions with technology companies in both the United States and Sweden. He received his education at Chalmers University of Technology in Gothenburg, Sweden where he majored in Computer Science and Computer Engineering.

Comments

Unless you know something

Our DBA Team configured the CERT on database and provide us with the .pem file, Can some let me know the steps which needs to be configured on tomcat for this to happen without any issues.
kata mutiara
puisi sahabat
pantun nasehat

DSASDASD

jimmy choo342AS
the north face outlet
red valentino
michael kors
louis vuitton sacs
cheap jordan shoes
rolex replica watches
michael kors handbags outlet
ed hardy
jordan shoes
cheap jordans
nike blazer
ralph lauren pas cher
adidas nmd
gucci borse
fitflops shoes
nike outlet store
michael kors handbags online
nike free 5
nike roshe
converse trainers
true religion jeans sale
adidas nmd
omega watches for sale
michael kors handbags wholesale
michael kors handbags
cheap basketball shoes
longchamps
michael kors outlet
michael kors handbags wholesale
cheap nfl jerseys wholesale
instyler max 2
nike huarache trainers
ed hardy outlet
pandora charms
michael kors handbags sale
tiffany and co outlet
lebron shoes
longchamp le pliage
skechers outlet
lebron james shoes
abercrombie and fitch
michael kors handbags
michael kors handbags
michael kors handbags
nike store uk
asics shoes
pandora jewelry
michael kors handbags
nike huarache
cheap mlb jerseys
cheap ray ban sunglasses
cheap nhl jerseys
jimmy choo shoes
nike store
michael kors outlet store
nike tn
michael kors outlet
michael kors outlet
toms shoes
cheap nike shoes
michael kors handbags
michael kors outlet
yeezy boost 350 black
michael kors handbags
michael kors handbags
polo ralph lauren
toms outlet
sac longchamp
fitflops sale clearance
michael kors uk
mlb jerseys
kobe 9
michael kors uk
nike air max 90
christian louboutin outlet
cheap michael kors handbags
nike blazer pas cher
cheap michael kors handbags
saics running shoes
ecco shoes outlet
ralph lauren outlet online
michael kors handbags
nike outlet
nike trainers uk
ghd hair straighteners
new balance outlet
hugo boss outlet
supra shoes
nba jerseys
nike air huarache
ralph lauren outlet
polo ralph lauren outlet
nike blazer low
michael kors outlet store
nike trainers uk
hugo boss sale
armani exchange
fitflops
air jordan uk
cheap jordans
michael kors handbags
tiffany and co
supra shoes sale
michael kors handbags
dolce and gabbana
cheap nike shoes sale
new balance shoes
nike air force 1
michael kors handbags wholesale
omega watches
nike trainers
gucci sito ufficiale
michael kors outlet online
salomon boots
armani exchange outlet
michael kors handbags
yeezy boost 350
christian louboutin shoes
nike huarache
instyler max
nike tn pas cher
valentino shoes
nike trainers
ed hardy clothing
under armour outlet
michael kors handbags
fitflops sale clearance
nike free
michael kors handbags
michael kors handbags
cheap oakley sunglasses
oakley sunglasses
salomon shoes
cheap oakley sunglasses
oakley sunglasses
ghd flat iron
michael kors handbags
the north face
chaussure louboutin
cheap oakley sunglasses
michael kors handbags
pandora outlet
michael kors handbags
salvatore ferragamo
moncler outlet
converse shoes
nike blazer pas cher
true religion jeans
adidas nmd r1
louis vuitton pas cher
ray ban sunglasses
jordan shoes
mont blanc pens
michael kors handbags wholesale
replica watches
ecco shoes
ralph lauren
ray ban sunglasses
michael kors handbags outlet
abercrombie and fitch kids
michael kors handbags clearance
cheap ray bans
longchamp bags
oakley sunglasses
versace
ed hardy uk
pandora jewelry
mont blanc pens outlet
cheap nfl jerseys
michael kors outlet
dolce and gabbana shoes
basketball shoes
nike huarache
michael kors outlet
nike air huarache
michael kors outlet
versace shoes
air force 1 shoes
cheap michael kors handbags
michael kors handbags outlet
michael kors outlet
cheap nba jerseys
under armour shoes
ferragamo shoes
adidas nmd runner
michael kors handbags
nike blazer
reebok shoes
michael kors handbags wholesale
skechers shoes
chaussure louboutin pas cher
dolce and gabbana outlet
michael kors handbags
michael kors outlet online
cheap michael kors handbags
birkenstock sandals
air max 90
michael kors outlet clearance
birkenstocks
nike roshe run
yeezy boost 350 white
reebok outlet
moncler jackets
michael kors handbags sale
kobe 9 elite
nhl jerseys
michael kors handbags
michael kors outlet

In the appearance there is

In the appearance there is annihilation Replica Handbags added important than cutting a artist brand, and if it comes to labels Gucci is a apple acclaimed characterization that stands for superior and appearance and class. Gucci handbags are acceptable superior handbags because they are fabricated from the best raw abstracts in this case they are louis vuitton replica fabricated from 18-carat Italian leather, the covering articles were aboriginal launched in 1921 in the Italian city-limits of Florence, Gucci did not alpha off big but in actuality had apprehensive ancestry and with time abound into the appearance Mulberry Replica Handbags behemothic that it is today. There are abounding altered Gucci designs of Gucci handbags that you can boutique about for, for archetype there is Gucci Boston, Gucci Abbey, Gucci Tote, Gucci Hobo, and Gucci classic, and Gucci Cruise, you don’t accept to biking to Italy to get Gucci handbags at http://www.vuittonsale.co.uk because they are readily attainable on the internet with online retailers such as.

http://www.rfshoeoutlets.co.uk

asda

http://dandiyasongs2016.blogspot.in/

SSL/JDBC connection between Tomcat and Oracle

We are using tomcat 8 & oracle 11g and we would like to configure SSL encryption between app & DB.

Our DBA Team configured the CERT on database and provide us with the .pem file, Can some let me know the steps which needs to be configured on tomcat for this to happen without any issues.

FYI: We are not using oracle wallet

Thanks,

Sunil

Re: Apache Tomcat

Your work is very good and I appreciate you for the info you have provided here. Thanks for taking the time to discuss this, I feel strongly that love and read more on this topic. Keep up the good Work.
directv family package

alan51

I read this article because it is not including worthless information passguide 1z0-436
. The author clearly describes the information. Thank you for sharing this types article. This will be very beneficiary for the readers passguide 300-460
.

Unless you know something

Unless you know something about scripts, it's quite hard to detect and solve any type of problem your software might have at some point. Once you understand how your apps work, you can try out the quickbooks accounting software vashon wa, especially if you own a business. Technology can really make things easier.

This is very academic content

This is very academic content and published well for something different click to investigate. It's awesome to see that some people still understand creating a quality post!

David

buy retweets These things are very important, good think so - I think so too... buy twitter followers

Could you please explain what

Could you please explain what you mean under the dead connection being detected out of the box? I looked through this and similar posts but to tell the truth I didn't understand entirely everything. I am sorry for my incompetence.
You just pay and we are writing an essays instead of you.

 

 

reply

I am no computer geek but this website has helped me to understand more on the different concepts of operating systems and fixing many issues in the OS and servers. I hope that you guys will be able to come up with a solution for this issue also. order cheese curds online

SSL/JDBC issue betweeb Tomcat and Oracle

Hello,

I'm trying to use SSL for encryption and server authentication between Oracle 11.2 with Tomcat 7.0.67 with Java 1.8 installed on Redhat 6.7 server. Currently, I'm using this document as a guide: http://www.oracle.com/technetwork/topics/wp-oracle-jdbc-thin-ssl-130128.pdf

So I have this configuration in context.xml file:

factory="org.apache.naming.factory.BeanFactory"
name="jdbc/DB" auth="Container"
type="com.mchange.v2.c3p0.ComboPooledDataSource"
driverClass="oracle.jdbc.OracleDriver"
jdbcurl ="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=servername)(PORT=2484))(CONNECT_DATA=(SERVICE_NAME=servicename)))");

In the catalina.sh file I have:

#JAVA_OPTS="-Djavax.net.ssl.trustStore=/opt/wallet/cwallet.sso -Djavax.net.ssl.trustStoreType=SSO -Doracle.net.ssl_cipher_suites=TLS_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA"

In the java security file I added this to the end of the line:

security.provider.9=oracle.security.pki.OraclePKIProvider

Here are the errors I receive when trying to connect to the db:

Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:439)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:454)
at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:693)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:251)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1140)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:340)
... 13 more
Caused by: oracle.net.ns.NetException: Unable to initialize ssl context.
at oracle.net.nt.CustomSSLSocketFactory.getSSLSocketFactory(CustomSSLSocketFactory.java:327)
at oracle.net.nt.TcpsNTAdapter.connect(TcpsNTAdapter.java:119)
at oracle.net.nt.ConnOption.connect(ConnOption.java:133)
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:405)
... 18 more
Caused by: oracle.net.ns.NetException: Unable to initialize the trust store.
at oracle.net.nt.CustomSSLSocketFactory.getTrustManagerArray(CustomSSLSocketFactory.java:415)
at oracle.net.nt.CustomSSLSocketFactory.getSSLSocketFactory(CustomSSLSocketFactory.java:311)
... 21 more
Caused by: java.security.KeyStoreException: SSO not found
at java.security.KeyStore.getInstance(KeyStore.java:851)
at oracle.net.nt.CustomSSLSocketFactory.getTrustManagerArray(CustomSSLSocketFactory.java:403)
... 22 more
Caused by: java.security.NoSuchAlgorithmException: SSO KeyStore not available
at sun.security.jca.GetInstance.getInstance(GetInstance.java:159)
at java.security.Security.getImpl(Security.java:695)
at java.security.KeyStore.getInstance(KeyStore.java:848)

Any help would be appreciated. Thanks.

workaround

adding the following to the connection pool config is a workaround but I would think a dead connection should be detected out of the box. the

testOnBorrow="true" validationQuery="SELECT 1 from dual" validationInterval="30000"

Regards

/sanjay

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.