Yes this would be a nice feature, a couple of days ago there was somebody else requesting a similar thing on commons-user.
A patch is very welcome.


One remark, I would stop the normal processing when an exception is thrown. If needed you can always handle error in a PL/SQL block or stored procedure.

-- Dirk

Brent Verner wrote:

  I've often had the need to perform some setup of a connection
before it can be used, such as:

ALTER SESSION SET current_schema = workable_schema;

As such, I've had a hacked version of dbcp around for a while
that adds an "activationStatement" and a "passivationStatement".
Both are fed thru the Statement.execute(String) method, and nothing is done with any (possible) ResultSet from the query.
These statements are executed in the activateObject() and passivateObject() methods (of PoolableConnectionFactory). If an
exception is thrown when executing either, a message is logged, and normal processing continues, i.e., a "bad" activationStatement
will not cause the connection to be considered "bad".


If this is something that might be considered for inclusion in dbcp, please give me some feedback/comments on the notes above and I'll send a patch.

cheers.
  Brent




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to