jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Schmidt <cschm...@prospricing.com>
Subject Question on ConnectionFactory.unwrap() method
Date Mon, 07 Mar 2011 13:54:23 GMT
 There is a method in the org.apache.jackrabbit.core.util.db.ConnectionFactory class that assumes
that a Connection instance will be a wrapped/delegate connection from DBCP. We are providing
a pooled datasource to JackRabbit through JNDI and the Connection being sent to this method
is not a wrapped instance (it's a regular Oracle Connection). I looked through the history
and the original connection pooling issue, but don't see a reason why there is a need for
a hard failure on line 206:

    public static Connection unwrap(Connection con) throws SQLException {
        if (con instanceof DelegatingConnection) {
            return ((DelegatingConnection)con).getInnermostDelegate();
        } else {
            throw new SQLException("failed to unwrap connection of class " + con.getClass().getName()
                ", expected it to be a " + DelegatingConnection.class.getName());

  If there are no objections, can this class be modified to return the passed in Connection
if it isn't wrapped? I've changed the code locally and it allows me to work with an Oracle
9i installation where before it failed with the SQLException being thrown above. I can open
an issue and provide the patch for the change.


  Chris Schmidt

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message