• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

session is closed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 686
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you please post complete code?
 
aitha suman
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont see SessionFactoryUtils.getSession(getSessionFactory() , false)
in the code above
 
My honeysuckle is blooming this year! Now to fertilize this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic