Hi,
I want to audit the database updates in some DAO classes I am using from my pages.
Obviously I'd only want to fire the auditing if the updates are commited successfully.
I already have some of the nastiness below in my DAO interfaces....
@CommitAfter
@PersistenceContext(unitName = "AuditDBUnit")
My auditing is done to a seperate db to the db I am auditing.
Is there a neat way to hook in post the successful commit to perform the auditing? I don't want to mess with my DAO or pages really, and would like an aspect orientated solution. I am not using JTA..
Is it possible to use some of this config stuff below to achieve the result?
@Match("*DAO")
public static void adviseTransactionally(JpaTransactionAdvisor advisor, MethodAdviceReceiver receiver) {
advisor.addTransactionCommitAdvice(receiver);
John
I want to audit the database updates in some DAO classes I am using from my pages.
Obviously I'd only want to fire the auditing if the updates are commited successfully.
I already have some of the nastiness below in my DAO interfaces....
@CommitAfter
@PersistenceContext(unitName = "AuditDBUnit")
My auditing is done to a seperate db to the db I am auditing.
Is there a neat way to hook in post the successful commit to perform the auditing? I don't want to mess with my DAO or pages really, and would like an aspect orientated solution. I am not using JTA..
Is it possible to use some of this config stuff below to achieve the result?
@Match("*DAO")
public static void adviseTransactionally(JpaTransactionAdvisor advisor, MethodAdviceReceiver receiver) {
advisor.addTransactionCommitAdvice(receiver);
John