Jeff Kin

Greenhorn
+ Follow
since Aug 02, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jeff Kin

Maybe a bit late; but for anyone else who may have this problem; it turned out i had put a backslash \ at the end on my CATALINA_HOME environment variable (I was using windows). When i removed it, i could start using catalina run command.
11 years ago
Using JSF/Richfaces and Hibernate. In my hybernate mapping file, i have put

<property name="current_session_context_class">thread</property>

I use getCurrentSession to get the session.

I have a class Order which contains a collection of OrderItem objects. I display a list of Orders in a xhtml page. The aim is that when i select a particular order, it will be displayed in a different xhtml page together with its children (OrderItems). However i get the "LazyInitializationException: Session has been closed" problem.

I am in a dilemma because for my implementation, i am forced to open transactions for everything, e.g. to get the list of Orders, i have to open and commit a transaction. Unfortunately, committing a transaction seems to close the session. How do i make the session to persist through the application session, while at the same time allowing commits to a Database?

Sorry, I am a new to this area.