Thank you for comments,

I will change to preferredTestQuery ...

One more question,
A friend offered setting socket read time out for such a problem

http://docs.oracle.com/cd/B28359_01/java.111/b31224/apxtblsh.htm#CHDBBDDA

Is there any way to set this value regardless of the underlying driver?
Because my application works on oracle and postgres as well.. 

Or this is not a c3p0 issue either :D
sorry for questions 

On 31 May 2012 10:03, <Vamshi.x.Tekuru@ampf.com> wrote:

Agree with Steve,
Default connection test is very slow during peak loads and changing it to preferredTestQuery improves the performance a lot.We had a similar issue and changing the Connection type fixed the issue.

Good luck,

Thanks,
Vamsi



Steve Waldman <swaldman@mchange.com>

05/31/2012 01:58 AM

To
sakin cali <sakinnncali@gmail.com>
cc
c3p0-users@lists.sourceforge.net
Subject
Re: [c3p0-users] My thread are hanging on "at        java.net.SocketInputStream.socketRead0(Ljava/io/FileDescriptor;        [BIII)I (Native Method)"





It seems like most of your issues are more likely to be Oracle-related than c3p0 related. c3p0 has no queryTimeout; it's an Oracle thing, see http://stackoverflow.com/questions/2376615/how-is-oracles-jdbc-query-timeout-implemented (Note the difference in case: queryTimeout, not queryTimeOut)

Your app is hanging inside of a c3p0 Connection test, which is occurring in response to an Exception thrown by an attempted use of the Connection. c3p0 is doing what it should, your database is failing to respond. It might be helpful for you to track down the earlier failure. That may give some indication of why subsequent database operations are hanging.

There is a c3p0 issue. You are using the default Connection test, which is very portable, but which is also slow and high-overhead. You'd be better off setting (in c3p0) either a preferredTestQuery or an automaticTestTable. See http://www.mchange.com/projects/c3p0/#configuring_connection_testing

Good luck!
   Steve



On May 31, 2012, at 1:59 AM, sakin cali wrote:

> Hi,
>
> I have a clustered, multi threaded application which uses c3p0 as connection pool to connect oracle database. My oracle driver is ojdbc6.jar...
>
> I don't know whether the problem is related to c3p0 or ojdbc6.jar...
>
> Below are the problem symptoms:
>
> 1. Lets say I have 10 threads in machine. This hanging problem is occured in every computer, but in someone all threads are hanged, in others some threads are hanged.. Hanging reason is not machine depended
> 2. Threads are hanged while going to different databases, so hanging is not related to database
> 3. In some cases threads are hanged on dual queries ( light-simple queries), hanging is not related to query time..
> 4. I have set queryTimeOut to 5 sn but threads hanged at socketRead0 method and cancelling is not working. At that point I want to ask a question. Who manages the query cancelling process. Does c3p0 spawns a thread for this cancelling issues or database manages the query cancelling or ojdbc?
> And why my queries are not cancelled although I have set queryTimeOut?
> 5. My application is working well until "something" happens. After that point my threads start hanging... They are not hanged at the same time... ( someone is hanged 1 hour later)
>
> Please give any idea about the origin of the problem
>
> king regards...
>
> Related thread dump:
> ------------------------------------------------
> Thread 0x592dce808
>   at java.net.SocketInputStream.socketRead0(Ljava/io/FileDescriptor;[BIII)I (Native Method)
>   at java.net.SocketInputStream.read([BII)I (SocketInputStream.java:129)
>   at oracle.net.ns.Packet.receive()V (Packet.java:300)
>   at oracle.net.ns.DataPacket.receive()V (DataPacket.java:106)
>   at oracle.net.ns.NetInputStream.getNextPacket()V (NetInputStream.java:315)
>   at oracle.net.ns.NetInputStream.read([BII)I (NetInputStream.java:260)
>   at oracle.net.ns.NetInputStream.read([B)I (NetInputStream.java:185)
>   at oracle.net.ns.NetInputStream.read()I (NetInputStream.java:102)
>   at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket()V (T4CSocketInputStreamWrapper.java:124)
>   at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read()I (T4CSocketInputStreamWrapper.java:80)
>   at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1()S (T4CMAREngine.java:1137)
>   at oracle.jdbc.driver.T4CTTIfun.receive()V (T4CTTIfun.java:290)
>   at oracle.jdbc.driver.T4CTTIfun.doRPC()V (T4CTTIfun.java:192)
>   at oracle.jdbc.driver.T4C8Oall.doOALL(ZZZZZLoracle/jdbc/internal/OracleStatement$SqlKind;I[BI[Loracle/jdbc/driver/Accessor;I[Loracle/jdbc/driver/Accessor;I[B[C[SILoracle/jdbc/driver/DBConversion;[B[[Ljava/io/InputStream;[[[B[[Loracle/jdbc/oracore/OracleTypeADT;Loracle/jdbc/driver/OracleStatement;[B[C[S[Loracle/jdbc/driver/T4CTTIoac;[I[I[ILoracle/jdbc/driver/NTFDCNRegistration;)V (T4C8Oall.java:531)
>   at oracle.jdbc.driver.T4CPreparedStatement.doOall8(ZZZZZ)V (T4CPreparedStatement.java:207)
>   at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe()V (T4CPreparedStatement.java:884)
>   at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe()V (OracleStatement.java:1167)
>   at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout()V (OracleStatement.java:1289)
>   at oracle.jdbc.driver.OraclePreparedStatement.executeInternal()I (OraclePreparedStatement.java:3584)
>   at oracle.jdbc.driver.OraclePreparedStatement.executeQuery()Ljava/sql/ResultSet; (OraclePreparedStatement.java:3628)
>   at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery()Ljava/sql/ResultSet; (OraclePreparedStatementWrapper.java:1493)
>   at oracle.jdbc.OracleDatabaseMetaData.getTables(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)Ljava/sql/ResultSet; (OracleDatabaseMetaData.java:3077)
>   at com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnectionNoQuery(Ljava/sql/Connection;[Ljava/lang/Throwable;)I (DefaultConnectionTester.java:185)
>   at com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnection(Ljava/sql/Connection;Ljava/lang/String;[Ljava/lang/Throwable;)I (DefaultConnectionTester.java:62)
>   at com.mchange.v2.c3p0.impl.DefaultConnectionTester.statusOnException(Ljava/sql/Connection;Ljava/lang/Throwable;Ljava/lang/String;[Ljava/lang/Throwable;)I (DefaultConnectionTester.java:143)
>   at com.mchange.v2.c3p0.AbstractConnectionTester.statusOnException(Ljava/sql/Connection;Ljava/lang/Throwable;Ljava/lang/String;)I (AbstractConnectionTester.java:82)
>   at com.mchange.v2.c3p0.impl.NewPooledConnection.handleThrowable(Ljava/lang/Throwable;)Ljava/sql/SQLException; (NewPooledConnection.java:437)
>   at com.mchange.v2.c3p0.impl.NewProxyStatement.executeQuery(Ljava/lang/String;)Ljava/sql/ResultSet; (NewProxyStatement.java:52)
> -----------------------------------
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________
> c3p0-users mailing list
> c3p0-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/c3p0-users


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
c3p0-users mailing list
c3p0-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/c3p0-users

----------------------------------------- ****************************************************************************** "This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you." ******************************************************************************