Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mchange.v2.c3p0.impl.NewPooledConnection - [c3p0] The following Exceptions occurred while trying to clean up a Connection's stranded resource #169

Open
jsusanto opened this issue May 25, 2023 · 1 comment

Comments

@jsusanto
Copy link

Hi Team,

I'm using c3p0 version: 0.9.5

I keep getting the following INFO exception.

========================================================================
INFO com.mchange.v2.c3p0.impl.NewPooledConnection - [c3p0]
The following Exceptions occurred while trying to clean up a Connection's stranded resources:

INFO com.mchange.v2.c3p0.impl.NewPooledConnection -
[c3p0 -- conection resource close Exception] java.sql.SQLException: JZ006:
Caught IOException: java.io.IOException: JZ0EM: End of data. at com.sybase.jdbc4.jdbc.ErrorMessage.
raiseError(Unknown Source) ~[jConnect-7.0.jar:?] at com.sybase.jdbc4.jdbc.ErrorMessage.
raiseErrorCheckDead(Unknown Source) ~[jConnect-7.0.jar:?] at com.sybase.jdbc4.tds.
TdsResultSet.next(Unknown Source) ~[jConnect-7.0.jar:?] at com.sybase.jdbc4.tds.
TdsResultSet.close(Unknown Source) ~[jConnect-7.0.jar:?] at com.sybase.jdbc4.
jdbc.SybResultSet.markDead(Unknown Source) ~[jConnect-7.0.jar:?]
at com.sybase.jdbc4.jdbc.SybResultSet.close(Unknown Source) ~[jConnect-7.0.jar:?] 2
at com.sybase.jdbc4.jdbc.SybResultSet.close(Unknown Source) ~[jConnect-7.0.jar:?] at

========================================================================

Below is the current configuration.

By any chance, do you know why I keep getting this INFO exception? how to resolve this issue?

Many thanks,

@swaldman
Copy link
Owner

When you close (really check in) a Connection, c3p0 tries to clean up any Statements or ResultSets that clients did not close, before making the Connection available again in the pool. Ideally, there should be no such stranded resources, because clients should use try-with-resources when working with Statements and ResultSets. But that is not always the case.

In this case, a client failed to clean up a ResultSet, c3p0 tried to clean that up (ie close()) that prior to making it available from the pool, but an Exception occurred when calling that close()

The best way to avoid this kind of thing is to take care to close() your Statements and ResultSets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants