*
The moose likes Object Relational Mapping and the fly likes How do you handle Hibernate in Enterprise environment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How do you handle Hibernate in Enterprise environment" Watch "How do you handle Hibernate in Enterprise environment" New topic
Author

How do you handle Hibernate in Enterprise environment

VenkataPrasad Regula
Ranch Hand

Joined: Jun 30, 2011
Posts: 63
In any Hibernate tutorial we find the following steps

1. Create a Session Factory
2. Create a session
3. Do the unit of work
4. Close the session.

In an enterprise environment, we have the following issues as
1. How to create the session for different pages
2. If the page has multiple tasks to be done on a single page
3. If the result is returned to a page we return the POJO, which indicates the session will still be open. How to close the session
4. If the session is closed before return we cant return to the results page as the whole conversation gets closed by session.close()


Prabaharan Gopalan
Ranch Hand

Joined: Oct 16, 2009
Posts: 66

May be this can be a starting point: http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/session-configuration.html#configuration-j2ee


Googling doesn't make you a genius. But not Googling makes you dumber.
 
 
subject: How do you handle Hibernate in Enterprise environment
 
Similar Threads
EJB References question/ why this answer?
illegalStateException after invalidating Session
[Newb] How to reuse attributes
Mock Exam Question(Repost)
Question from ejbcertificate.com