Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

EJB3- hibernate JPA problem while creating hibernate interceptor

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

My basic aim is do auditing on all tables for updates and deletes. I am using an EJB3 application which is in turns using Hibernate below it to make database calls.

I had implemented this kind of auditing before for spring-hibernate framework using Hibernate Interceptors.

So Now I am trying to do the same with EJB3. I specified my interceptor in persistence.xml file like - <property name="hibernate.ejb.interceptor" value="com.nihilent.model.audit.AuditLogInterceptor"/>

But I need an open hibernate session object in this interceptor class so that I can add audit entries into the database. I tried many tricks but they dint work. So guys give me some solution which really works....

I don't even get entityManager object in this class which I think is because this class is not recognized by EJB3 but only by hibernate.....

Guys please help me out here.... Am in desperate need of this.....

Thanks,
Rohan.
 
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you considered session bean interceptors?
 
Stinging nettles are edible. But I really want to see you try to eat this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic