[jboss-user] [JBoss Seam] - Re: release connection after lazy init in view

imario do-not-reply at jboss.com
Tue May 22 14:40:56 EDT 2007

I think we could be able to find a solution for it. Using eager loading is one of them, though, I see three drawbacks:

1) you have to know what the view requests from your entities - in our theoretical case where the view and the backing bean author are different persons you might not be able to know this ...

2) you have to pollute your backing bean with database system code.
We access the database through DAO classes, now, the same method to retrieve a list of entities has to be duplicated just to have once lazy loading or in the other case eager loading

3) the ORM mapper looses some of its transparency

I don't know whats "silly" on my post or my proposed solution which is just a start of a discussion.
At least my solution keeps the ORM transparency and you have to do NOTHING in your backing bean, DAO or somewhere else in your code.

I am sure tons of developers out there do not even know what it means having an open Connection laying around, in the worst case until the conversation times out.
With multiple conversations (say 2 per user) and say 50 user you might end with 100 active Connections (in the worst case for sure).

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

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

More information about the jboss-user mailing list