• Post Reply Bookmark Topic Watch Topic
  • New Topic

EntityManger and Session in Hibernate

Ganesh Choudhary
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want something to execute on openSession and closeSession event of hibernate. When Hibernate API is used to persist the object i am able to do it . I have put aspects around openSession() and closeSession() methods and there i can execute my own logic but when Java Persistence API is used to persist an object i am not able to do it. when we call the close() method on entityManager's object it goes to aspect i have put on session.close() method but it never goes to the aspect put on openSession() event. so what to do ?? Can you people please help me ?

Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!