File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session is closed

 
aitha suman
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 686
Chrome Netbeans IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you please post complete code?
 
aitha suman
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 686
Chrome Netbeans IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont see SessionFactoryUtils.getSession(getSessionFactory() , false)
in the code above
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic