@Override public void beforeCompletion() { if (shouldUnbindAtCompletion()) { TransactionSynchronizationManager.unbindResource(this.resourceKey); this.holderActive = false; if (shouldReleaseBeforeCompletion()) { releaseResource(this.resourceHolder, this.resourceKey); } } }
@Override public void beforeCompletion() { if (shouldUnbindAtCompletion()) { TransactionSynchronizationManager.unbindResource(this.resourceKey); this.holderActive = false; if (shouldReleaseBeforeCompletion()) { releaseResource(this.resourceHolder, this.resourceKey); } } }
@Override public void afterCompletion(int status) { if (shouldUnbindAtCompletion()) { boolean releaseNecessary = false; if (this.holderActive) { // The thread-bound resource holder might not be available anymore, // since afterCompletion might get called from a different thread. this.holderActive = false; TransactionSynchronizationManager.unbindResourceIfPossible(this.resourceKey); this.resourceHolder.unbound(); releaseNecessary = true; } else { releaseNecessary = shouldReleaseAfterCompletion(this.resourceHolder); } if (releaseNecessary) { releaseResource(this.resourceHolder, this.resourceKey); } } else { // Probably a pre-bound resource... cleanupResource(this.resourceHolder, this.resourceKey, (status == STATUS_COMMITTED)); } this.resourceHolder.reset(); }
@Override public void afterCompletion(int status) { if (shouldUnbindAtCompletion()) { boolean releaseNecessary = false; if (this.holderActive) { // The thread-bound resource holder might not be available anymore, // since afterCompletion might get called from a different thread. this.holderActive = false; TransactionSynchronizationManager.unbindResourceIfPossible(this.resourceKey); this.resourceHolder.unbound(); releaseNecessary = true; } else { releaseNecessary = shouldReleaseAfterCompletion(this.resourceHolder); } if (releaseNecessary) { releaseResource(this.resourceHolder, this.resourceKey); } } else { // Probably a pre-bound resource... cleanupResource(this.resourceHolder, this.resourceKey, (status == STATUS_COMMITTED)); } this.resourceHolder.reset(); }
@Override public void beforeCompletion() { if (shouldUnbindAtCompletion()) { TransactionSynchronizationManager.unbindResource(this.resourceKey); this.holderActive = false; if (shouldReleaseBeforeCompletion()) { releaseResource(this.resourceHolder, this.resourceKey); } } }
@Override public void beforeCompletion() { if (shouldUnbindAtCompletion()) { TransactionSynchronizationManager.unbindResource(this.resourceKey); this.holderActive = false; if (shouldReleaseBeforeCompletion()) { releaseResource(this.resourceHolder, this.resourceKey); } } }
@Override public void afterCompletion(int status) { if (shouldUnbindAtCompletion()) { boolean releaseNecessary = false; if (this.holderActive) { // The thread-bound resource holder might not be available anymore, // since afterCompletion might get called from a different thread. this.holderActive = false; TransactionSynchronizationManager.unbindResourceIfPossible(this.resourceKey); this.resourceHolder.unbound(); releaseNecessary = true; } else { releaseNecessary = shouldReleaseAfterCompletion(this.resourceHolder); } if (releaseNecessary) { releaseResource(this.resourceHolder, this.resourceKey); } } else { // Probably a pre-bound resource... cleanupResource(this.resourceHolder, this.resourceKey, (status == STATUS_COMMITTED)); } this.resourceHolder.reset(); }
@Override public void afterCompletion(int status) { if (shouldUnbindAtCompletion()) { boolean releaseNecessary = false; if (this.holderActive) { // The thread-bound resource holder might not be available anymore, // since afterCompletion might get called from a different thread. this.holderActive = false; TransactionSynchronizationManager.unbindResourceIfPossible(this.resourceKey); this.resourceHolder.unbound(); releaseNecessary = true; } else { releaseNecessary = shouldReleaseAfterCompletion(this.resourceHolder); } if (releaseNecessary) { releaseResource(this.resourceHolder, this.resourceKey); } } else { // Probably a pre-bound resource... cleanupResource(this.resourceHolder, this.resourceKey, (status == STATUS_COMMITTED)); } this.resourceHolder.reset(); }