1
votes

We have a custom transaction manager that does some audit work as each transaction begins. But we are retrofitting this into a spring-ldap app, and it's declared like this:

<ldap:transaction-manager id="ldapTransactionManager" session-factory-ref="sessionFactory" >
   <ldap:default-renaming-strategy />
</ldap:transaction-manager>

We want to hook into the doBegin of that class which appears to be ContextSourceAndHibernateTransactionManager. But there's no attribute of ldap:transaction-manager> that I see which would allows me to subclass and supply my own. Or is there some listener I can plug into? I just need to run a little code each doBegin of the transaction.

Perhaps see here. Inherit and register with Spring (by id and hook into the config - in your code), if it will fit the purpose? - h.alex
@h.alex - That is the class I want to subclass. But how to get spring-ldap to use my subclass instead of that one, is the question. That is the class that <ldap:transaction-manager> uses by default. I just don't see how to override it. - Entropy