https://issues.apache.org/bugzilla/show_bug.cgi?id=51879
Bug #: 51879 Summary: Improve need to access Native Interfaces Product: Tomcat Modules Version: unspecified Platform: PC OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: jdbc-pool AssignedTo: dev@tomcat.apache.org ReportedBy: you...@gmail.com Classification: Unclassified I'm attempting to use tomcat-jdbc with Oracle Streams AQ. Oracle Streams AQ requires a connection of type OracleConnection. Streams AQ will also under some circumstances close the OracleConnection it is using. If I use unwrap to get an OracleConnection and then Streams AQ closes that connection it will leave my tomcat-jdbc pool in a messed up state since connections will be closed that tomcat-jdbc thinks are open. I can see 2 ways tomcat-jdbc may be able to help simplify this use case for developers: 1. Tomcat JDBC can proxy connections it returns from Wrapper.unwrap with the interface provided. Currently tomcat-jdbc's ProxyConnection class will only unwrap to PooledConnection or XAConnection. Otherwise it simply returns the physical connection. For example, if I am using the ResetAbandonedTimer interceptor and need to take advantage of an Oracle specific method in oracle.jdbc.OracleConnection I would like to be able to invoke: OracleConnection oraCon = connection.unwrap(OracleConnection.class); oraCon.someOracleSpecificCommand(); my use of oraCon could still invoke ResetAbandonedTimer. Or if I were to invoke oraCon.close() this should correctly return this connection to the pool. FYI, this is how Websphere's connection pool implements unwrap. 2. When creating the original connection in org.apache.tomcat.jdbc.pool.ConnectionPool.getProxyConstructor() include in the proxied interfaces any interfaces the native connection also implements. That way I wouldn't need to unwrap the tomcat-jdbc provided connection since it will already implement the native connection's interfaces. FYI, this is how Oracle UCP works. Thoughts? I'd be happy to provide a patch if the functionality is desirable. Mike -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org