This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Spring and the fly likes session is closed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "session is closed" Watch "session is closed" New topic
Author

session is closed

aitha suman
Greenhorn

Joined: Oct 31, 2011
Posts: 2
Hi,

I am using below code for getting a session in a method of serviceImpl class and calling this method from a run method of a thread class.

SessionFactoryUtils.getSession(getSessionFactory() , false)

but in production i got a hibernate exception and session is closed and exception details are below. This exception is came only once.



Please give me solution for this issue and tell me why it is coming
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

can you please post complete code?


===Vyas Sanzgiri===
My Blog
aitha suman
Greenhorn

Joined: Oct 31, 2011
Posts: 2
if (totalQSShares > 0)
{
QuicksellType quicksellType = (QuicksellType) session.load(QuicksellType.class, isForcedQS ? "FORCED" : "ELECTIVE");
QuicksellStatus quicksellStatus = (QuicksellStatus) session.load(QuicksellStatus.class, "BATCHREL");

Quicksell quicksell = new Quicksell();
quicksell.setQty(new Double(totalQSShares));
quicksell.setBatch(equityBatchLoadCntl);
quicksell.setType(quicksellType);
quicksell.setStatus(quicksellStatus);
quicksell.setLastUpdatedBy(loginUser);

session.save(quicksell);
}
tx.commit();


The above code deployed in websphere server.
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

I dont see SessionFactoryUtils.getSession(getSessionFactory() , false)
in the code above
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: session is closed
 
Similar Threads
One to One not cascading on insert - IdentifierGenerationException
Problem with inserting new data into database using hibernate
SQLGrammerException in Hibernate
Hibernate Err:NonUniqueObjectException
how to assign compsite keys manually