posted 7 years ago
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 ?