google-code-export / mybatis

Automatically exported from code.google.com/p/mybatis
0 stars 0 forks source link

Max time limit for connection in idle state. #678

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the MyBatis are you using?
mybatis 3.1.1

Please describe the problem.  Unit tests are best!
Unit Tests are not possible as this happens only when the Connection is not 
used for 30 minutes. The issue is as follows
1. User connects to Sybase DB using a POOLED DataSource 
2. System is left idle for 30 minutes
3. User executes a query after this time period
4. The application freezes at the point where the 
conn.getRealConnection().isClosed() method is called in PooledDataSource.java's 
pingConnection method.
5. The response take around 16 minutes to return (Introscope logs show that 
sp_mda procedure take around the same time to execute)
6. Problem not occurring with UNPOOLED data source as we are able to specify 
driver.IS_CLOSED_TEST property to INTERNAL 

It would be very helpful if there is way to remove the idle connections with a 
max time in idle state.

What is the expected output? What do you see instead?

Expect the connection to service the requests even if the time period between 2 
requests is > 30 minutes

Attached the patch file we used to invalidate the connection, if it idle for 
more than 10 minutes.

Can you provide stack trace, logs, error messages that are displayed?
No exception stack trace available as it is not erred out. The isClosed() 
method just waits for the sp_mda procedure to complete. For additional 
information follow the link provided below.

Please provide any additional information below.
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc39001
.0700/html/prjdbc0700/BHCIAIBF.htm 

Original issue reported on code.google.com by rk.cheru...@gmail.com on 25 Sep 2012 at 11:41

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by eduardo.macarron on 13 Oct 2012 at 6:21