• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Starting a different transaction in the method through Spring

 
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic