]java.sql.SQLException: Io exception: Connection reset

Ask around here!

]java.sql.SQLException: Io exception: Connection reset

Postby bongdadienanh1 » Tue May 10, 2011 10:19 am

I am using version 0.7.1

The my system get connection pool but when the system idle 30minutes . I don't get connection and have error "java.sql.SQLException: Io exception: Connection reset".
Please help me ! I don't know why and config parameter of bonecp.
bongdadienanh1
 
Posts: 12
Joined: Sat May 07, 2011 4:57 am

Re: ]java.sql.SQLException: Io exception: Connection reset

Postby wwadge » Tue May 10, 2011 10:42 am

Use idleConnectionTestPeriodInMinutes and idleMaxAgeInMinutes.

You may still get that exception for it means that the DB or the network went down at some point. Your application must be ready to handle any SQLExceptions.

Wallace
wwadge
Site Admin
 
Posts: 713
Joined: Mon Oct 19, 2009 7:50 pm

Re: ]java.sql.SQLException: Io exception: Connection reset

Postby bongdadienanh1 » Wed May 11, 2011 4:16 am

Hi Wallace,

My application handle any SQLExceptions. I tried to use 2 times the error messages are getting across, but why do that to the 3rd, the system does not receive that error again, why I do not know when to leave the system in 30 minutes does not affect What was it like this or this is the fault of the road network from bonecp or application server to database problems.


Log error :
java.sql.SQLException: Io exception: Connection reset
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:976)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3390)
at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4223)
at com.jolbox.bonecp.PreparedStatementHandle.execute(PreparedStatementHandle.java:163)
at com.viettel.ussdPay.receiver.services.USSDPayBusiness.checkIsdnPostPaid(USSDPayBusiness.java:427)
at com.viettel.ussdPay.receiver.services.USSDPayBusiness.confirmSystem(USSDPayBusiness.java:459)
at com.viettel.ussdPay.receiver.process.ThreadUSSDReceiver.process(ThreadUSSDReceiver.java:58)
at com.viettel.mmserver.base.ProcessThread.run(ProcessThread.java:125)
at java.lang.Thread.run(Thread.java:619)

version bonecp : 0.7.0 , guava-r07

this.config = new BoneCPConfig();
this.config.setJdbcUrl("jdbc:oracle:thin:@localhost:1521:test");
this.config.setUsername("test");
this.config.setPassword("test");
this.config.setMaxConnectionsPerPartition(5);
this.config.setMinConnectionsPerPartition(2);
this.config.setConnectionTimeout(TimeUnit.MILLISECONDS.convert(60, TimeUnit.MINUTES));
this.config.setIdleMaxAge(0);
this.config.setPartitionCount(1);
this.config.setConnectionTestStatement("select 1 from dual");
this.config.setInitSQL("select 1 from dual");
this.config.setAcquireRetryAttempts(7);
this.config.setAcquireRetryDelay(10000);


Please help me.
bongdadienanh1
 
Posts: 12
Joined: Sat May 07, 2011 4:57 am

Re: ]java.sql.SQLException: Io exception: Connection reset

Postby wwadge » Wed May 11, 2011 9:16 am

bongdadienanh1 wrote:Hi Wallace,

version bonecp : 0.7.0 , guava-r07


Please help me.


Before anything else, please switch to version 0.7.1.RELEASE and try with that
wwadge
Site Admin
 
Posts: 713
Joined: Mon Oct 19, 2009 7:50 pm

Re: ]java.sql.SQLException: Io exception: Connection reset

Postby bongdadienanh1 » Wed May 11, 2011 10:07 am

I use this version 0.7.1 also receive the same error
bongdadienanh1
 
Posts: 12
Joined: Sat May 07, 2011 4:57 am

Re: ]java.sql.SQLException: Io exception: Connection reset

Postby wwadge » Wed May 11, 2011 10:12 am

Connection reset means the network connection is being terminated. You will still receive that error in your application and you need to handle SQLException to rollback your transactions.

Also please set idleConnectionTestPeriodInMinutes and idleConnectionMaxAgeInMinutes

Wallace
wwadge
Site Admin
 
Posts: 713
Joined: Mon Oct 19, 2009 7:50 pm


Return to BoneCP - Help, Q&A, Whatever!

Who is online

Users browsing this forum: No registered users and 3 guests