Skip to main content

jdbc connection pool - destroying resource error , writing to socket error

3 replies [Last post]
milliemc
Offline
Joined: 2008-12-03
Points: 0

I have a webservice deployed to Glassfish V2 using a JDBC connection pool.
Error (count of 4) occurs in log file every 10 minutes after idle time expires; error shows each morning after no activity during the night

Message ID: RAR5035 - complete message: Unexpected exception while destroying restorce.
Message ID: Error while destroying resource complete message error while writing to socket.
(this message repeats again)

The ThreadID and name value pair are the same for each error
Pool settings: Inital/Min = 2

Thanks to anyone that can help with the error.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jr158900
Offline
Joined: 2005-04-13
Points: 0

* could you post the connection pool configuration ?
* It is possible that the database may timeout the idle connections before connection pool's idle timeout resizer removes the connection and hence the destroy operation is throwing the exceptions.
* Try enabling FINEST log level for "module-log-level" connector & resource-adapter and post the log.

milliemc
Offline
Joined: 2008-12-03
Points: 0

Thank you so much for responding; I'm new to using Glassfish
The "module-log-level" helped.
The database timeout for the idle connections has been changed to "never" and I'm not seeing the destroy errors now.

I still have a problem with my pool connection availablity consistency. I tested with 2 threads; each received near 500 responses then the pool became unavailable.
I hava attached a log file with the one error I can see.

database settings:
max servers = 32
available = 1
initial = 2
server idle timeout =40 minutes
connection idle timeout = 0

glassfish pool settings:
resource type = javax.sql.DataSource
initial/min pool = 2 connections
max pool = 10 connections
pool resize = 1 connection
idle timeout = 5 minutes
validation method = auto-commit
wrap JDBC objects = enabled
leak timeout = 5 seconds
leak = reclaim enabled

Any ideas for me?

jr158900
Offline
Joined: 2005-04-13
Points: 0

I see that you have enabled leak-tracing & leak-reclaim. [You may have to set leak-tracing timeout for a larger value]
For more details on leak-tracing :
http://blogs.sun.com/kshitiz/entry/connection_leak_tracing

Looking at the stack trace there seems to be a connection leak by application. Suspect code is :

gov.shelbycountytn.ws.utilities.JdbcConnect.JdbcConn(JdbcConnect.java:35)
gov.shelbycountytn.ws.jss.BookingsOnIndictmentDao.getBookingsOnIndictment(BookingsOnIndictmentDao.java:18)
gov.shelbycountytn.ws.grandJury.CaseJacket.getBookingsOnIndictments(CaseJacket.java:124)
gov.shelbycountytn.ws.grandJury.CaseJacketDelegate.getBookingsOnIndictments(CaseJacketDelegate.java:56)

* Probably you will have to fix the code that is leaking the connection.
* When your pool is unsresponsive, do you see any error message (other than the one you have attached) ? If you dont see any exception, please post the jstack (thread dump) of appserver process.