Hi,
I have this scenario where i need to audit certain operations and insert rows in some audit table.
So i have taken this approach, whenever the method A in class A is called which does that operation, i call my auditService's method B to insert the record in the audit table. Now, i have marked the propagation on method B as REQUIRES_NEW so that always a new transaction is created whenever the audit record is created.
I am able to successfully make it work but i was thinking is it possible to start the second transaction in a second
thread so that the initial thread is not delayed in any way.
I could use the java.util.Timer API for it, but somehow something doesn't look right.
Any thoughts/suggestions please.
Thank you
Rahul