I'm working on a multi-tenant application using c3p0.  I'm managing a single connection pool for all Tenants.  Upon checkout, I want to test the connection as well as initialize it for use by the current Tenant (which is established early in request processing).

ConnectionCustomizer.onCheckout() or (Unified)ConnectionTester.activeCheckConnection() seem like ideal locations for my test and initialization logic. In some cases, I want to toss the current connection, and retrieve another from the pool (or create a new connection as necessary).  The "retry" built into the callers of these functions implements this very logic.

HOWEVER, in other cases, I want to abort the current request altogether, and the caller's retry logic seems to prevent me from doing so.

While ConnectionCustomizer.onCheckout() is declared to throw Exception, the caller catches Exception, tosses the connection, and tries again.  ConnectionTester.activeCheckConnection() returns the status of the connection, but there is no status for "abort the request".  So, in both locations, I see no way to abort the current request.  :-(

Any ideas?

Thank you, in advance, for your assistance.

-John Hardin