Atomikos Forum

TestQuery is executed for a long time

Hello community!
I'm using 3.8.0 atomicos, spring 3.1.1, Tomcat 7. Oracle 11.
I need an advice.

My testQuery to AtomikosDataSourceBean is "SELECT 1 FROM DUAL".
My web application periodically stops working. Cause is thread blocking on com.atomikos.datasource.pool.ConnectionPool#borrowConnection.
Cause of this case is next:
One thread called "borrowConnection"(method is synchronized). Then it called com.atomikos.datasource.pool.AbstractXPooledConnection#createConnectionProxy and then tried testing connection by testQuery.

From the thread dump I saw that other threads waiting for monitor(instance of ConnectionPool).
Application stops work and customers want to reboot application. But!! (see my previos topic default82df.html?community.6.3330.1). Nobody can stop application without forcing shutdown or kill process.

Today I waited for error and saw following:
com.atomikos.datasource.pool.CreateConnectionException: Error executing testQuery
    at com.atomikos.jdbc.AtomikosXAPooledConnection.testUnderlyingConnection(AtomikosXAPooledConnection.java:128) ~[transactions-jdbc-3.8.0.jar:na]
.....
Caused by: java.sql.SQLRecoverableException: IO Error: Connection timed out
    at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:889) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1175) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1296) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1916) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1878) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:318) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at com.atomikos.jdbc.AtomikosXAPooledConnection.testUnderlyingConnection(AtomikosXAPooledConnection.java:124) ~[transactions-jdbc-3.8.0.jar:na]
    ... 56 common frames omitted
Caused by: java.net.SocketException: Connection timed out
    at java.net.SocketInputStream.socketRead0(Native Method) ~[na:1.7.0_45]
    at java.net.SocketInputStream.read(SocketInputStream.java:152) ~[na:1.7.0_45]
    at java.net.SocketInputStream.read(SocketInputStream.java:122) ~[na:1.7.0_45]
    at oracle.net.ns.Packet.receive(Packet.java:308) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at oracle.net.ns.DataPacket.receive(DataPacket.java:106) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:324) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at oracle.net.ns.NetInputStream.read(NetInputStream.java:268) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at oracle.net.ns.NetInputStream.read(NetInputStream.java:190) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at oracle.net.ns.NetInputStream.read(NetInputStream.java:107) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:124) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:80) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1137) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:350) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:195) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:876) ~[ojdbc6-11.2.0.4.jar:11.2.0.3.0]
    ... 62 common frames omitted

So, Why Does it takes a long time?
The testQuery is executed for about 15 minutes!! Is it a standard I/O timeout for oracle connection?

Thanks a lot.
Sergey Send private email
Thursday, May 07, 2015
 
 
Hi,

Your DBA should be able to tell you if the query takes a long time in Oracle or not?

The testQuery does a roundtrip to the database inside a synchronised block. Since the 3.9 release we offer maxLifetime instead - see http://www.atomikos.com/Main/ExtremeTransactions3dot9dot0

I recommend you try with 3.9 first. Whatever problems remain after that, we can solve if you find the budget for a supper subscription.

Hope this helps!
Guy Pardon Send private email
Monday, May 11, 2015
 
 
Thanks for answer.

In oracle AVR Report, this query is not displayed (I think it lost at socket I/O)

I'm going to try 3.9 release with maxLifetime parameter.

But if I set maxLifetime about 1 minute and my query wasn't exexcuted in this time (a lot of data). What will happened?

Will my connection be brocken?

Thanks in advice.
Sergey Send private email
Tuesday, May 12, 2015
 
 
The maxLifetime needs to be high enough to avoid interference with ongoing queries, but lower than the timeout settings for your firewall (if any).
Guy Pardon Send private email
Tuesday, May 12, 2015
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics