title: How to get entity manager or transaction in jpa listener
body: <p>I was using Hibernate event listener like <code>PostDeleteEventListener, PostInsertEventListener, PostUpdateEventListener</code> to do some operations during insert, delete and update. Now I would like to use JPA listener to do this because if I like to move from Hibernate to any other JPA provider my listener should work. Hibernate listener gives me <code>event</code> from which I can get the transaction and check whether its committed or rollback. JPA listeners only provides me the entity object. Now how can I get the transaction or session or entity manger in the JPA listener?? Thanks in advance!! I am using Jboss as my CMT.</p>