• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

spring transacion listener

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have a custom transaction manager in use in most of our apps that does a bit of work in the doBegin but otherwise just defers everything to it's superclass (the spring class).  This little bit of work is necessary for an audit logging requirement.

However, we have one app that uses spring-ldap, and that transaction manager has no attribute that allows us to specify an alternate class.  So I am looking for how to get my hooks in to run my bit of code before every transaction.  The transaction manager class seems to be determined internal to sping-ldap when we make this declaration:



If there's a way other than subclassing, like registering a listener somewhere that can give us access to the jdbc connection early enough in the transaction, we can use that.  Of if someone knows how to make spring-ldap use a custom subclass, that would work.
 
Saloon Keeper
Posts: 26275
186
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Um, you do realize that LDAP doesn't use jdbc, don't you? LDAP is a completely different protocol from jdbc.
 
Brian Mulholland
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

Yes, but spring-ldap supports BOTH a jdbc transaction and an ldap connection that it simulates transactional control over by using an offsetting transaction when you want to rollback.  Thus it simulates an XA transactional environment even though LDAP doesn't support it.

But because our regular jdbc transactions all need this audit logging code, we want this one to have it too.  It's just proving harder to get my claws into the spring workings so that I can make it work like the jdbc one works.

If you know anything, even just a lead it might get me closer?
 
You had your fun. Now it's time to go to jail. Thanks for your help tiny ad.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic