Non-fatal SQLException swallowed and all connections killed

Bug #1258339 reported by Francis De Brabandere on 2013-12-05
This bug affects 6 people
Affects Status Importance Assigned to Milestone

Bug Description

Bonecp 0.8.0.RELEASE

I have been looking into this issue the whole day, this clearly should be fixed ASAP as I think it might also be the cause of my other bonecp issues

Logged by bonecp:

[error] 2013-12-06 00:25:37,694 c.j.b.ConnectionHandle - Database access problem. Killing off this connection and all remaining connections in the connection pool. SQL State = HY000

My code gets a SQLException:

java.sql.SQLException: Connection is closed!
 at com.jolbox.bonecp.ConnectionHandle.checkClosed( ~[bonecp.jar:na]
 at com.jolbox.bonecp.ConnectionHandle.setAutoCommit( ~[bonecp.jar:na]

Real cause
  MySQL non-null field missing default value

The problem here is that the original MySQL SQLException is swallowed. I got to log it by implementing my own connection hook:

013-12-05 22:23:45,156 - [ERROR] - com.jolbox.bonecp.hooks.AbstractConnectionHook - - Possibly broken: Field 'created_at' doesn't have a default value
java.sql.SQLException: Field 'created_at' doesn't have a default value

Two things need to be fixed:
* at least also log the original exception trace when logging the Database access problem
* I see no reason for closing all connections when this kind of SQLException happens, this is a major bug!

there is a pull request for this

Wallace Wadge (wwadge) wrote :


Great, thanks. Do you have a snapshot Repo with a recent snapshot available?

So currently the exception swallowing remains an issue?

Alexey Panteleev (alexey-0) wrote :

It would be nice to get this SNAPSHOT. In my case a string in utf8mb4 is inserted into a utf8 field and that results in an SQLException, HY000. Nothing special really, simply incompatible character set but BoneCP ends up killing all connections :(

Devon Humes (devon-humes) wrote :

This is still an issue. Are there any plans to fix?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers