[jboss-user] [JBoss Seam] - Re: release connection after lazy init in view
imario
do-not-reply at jboss.com
Tue May 22 15:29:57 EDT 2007
Ok, looks like I found another solution/workaround.
I provide my own Hibernate ConnectionProvider (by decorating the original one). This provider hands out so called "DisconnectableConnections" and keeps track of all borrowed/released connections.
In a ServletFilter (at the end of the response) all not release connections will be "disconnected".
Notice, Hibernate still holds the DisconnectableConnection and thinks everything is fine.
One the next access via such a connection (which is "discconnected") it will be automatically reconnected.
"disconnected" in this context simply means it has been passed back to the connection pool.
Instead of using a ConnectionProvider one might simply decorate the connection pool itself ... but this is another story, though, it should work with any orm mapper then.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047696#4047696
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047696
More information about the jboss-user
mailing list