[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Connection striping (or labeling) with JBoss and Hiberna

pulkitsinghal do-not-reply at jboss.com
Wed Feb 25 18:46:05 EST 2009


It usually make sense to leverage Hibernate’s DriverManagerConnectionProvider when working with a DataSource configured via config files and accessible via JNDI.

But the problem is that the JBoss implementation of the DataSource mechanism ... wraps the Connection objects in a Wrapper (WrappedConnection.java) every time.

It is possible to get at the underlying connection by casting the Connection object to WrappedConnection and then invoking the getUnderlyingConnection() method. This is great as it allows Connection objects to be identified as they come & go to the pool over and over. BUT isn't there a cleaner way to do this?

In Java 1.6, the Connection interface extends the Wrapper interface which requires the implementation of a unwrap() method, that seems a lot more generic but I'm not sure which version of JBoss is up to date with Java 6 in order to allow its user to do that... any comments?

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4213205#4213205

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4213205




More information about the jboss-user mailing list