Menu

#33 query exception calls overkilling c.getMetaData().getTables

closed
nobody
None
5
2006-08-29
2006-04-27
No

Hello,

I found that, even though "preferredTestQuery" is
set C3p0 still calls getMetaData().getTables to check
connection.

When C3p0 intercepts exceptions executing queries it
calls method NewPooledConnection.handleThrowable(
Throwable t ), so checks connection status with this
line:

int status = connectionTester.statusOnException(
physicalConnection, sqle );

The method statusOnException(Connection c, Throwable
t) of DefaultConnectionTester calls statusOnException(
c, t, null ) which calls activeCheckConnection
(Connection c).
The latter runs:

rs = c.getMetaData().getTables( null,
null, "PROBABLYNOT", new String[] {"TABLE"} );

which is overkilling when used with Oracle and the
query exception is repeated frequently.

IMHO this is a bug because config "preferredTestQuery"
is ignored even when set with a specific query.

Regards,
Andrea

Discussion

  • Steve Waldman

    Steve Waldman - 2006-08-29

    Logged In: YES
    user_id=175530

    Hi. Sorry for the very long delay, and thank you for the detailed report. This
    issue will be fixed as of c3p0-0.9.1-pre7, to be released shortly.

     
  • Steve Waldman

    Steve Waldman - 2006-08-29
    • status: open --> closed
     

Log in to post a comment.