[jboss-dev-forums] [Design of JBoss Transaction Services] - Calling Synchronization.afterCompletion() more than once

bstansberry@jboss.com do-not-reply at jboss.com
Wed Mar 14 12:48:23 EDT 2007


Can a Synchronization's afterCompletion() method be called more than once, e.g in a recovery scenario or something?

I'm wondering because I wrote some unit tests that check for classloader leaks following an undeployment.  If transactions are used, test shows reference chains leading back to JBossTS via a Synchronization.  My assumption is JBossTS releases the ref to the Synchronization in some later cleanup task.

Having the test try to figure out when the TM will clean up the Synchronization ref is pretty unworkable, so a seemingly simple workaround was to have the Synchronization null out its state in afterCompletion().  But that's not good if afterCompletion() can potentially be called again.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4028035#4028035

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4028035



More information about the jboss-dev-forums mailing list