• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use session.get and getCurrentSession in same transaction

 
strutsBie hote
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using getCurrentSession in hibernate with which i am saving a object1.I do not commit the save
Now while saving another object2 i also need object1.

Earlier while with openSession i used to to call

session.get(Sample.class, SampleIdOfObject1)

But now i can't use this method because there is no object with it's id as SampleIdOfObject1.

I dont want to use Sessions.

 
varun Dosapati
Ranch Hand
Posts: 31
Java Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you provide more information.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic