OctaviusSessionSynchronization

Ends the transaction-scoped session at the right point in Spring's completion sequence.

ResourceHolderSynchronization carries the binding for us, including suspend and resume - a REQUIRES_NEW transaction inside another one gets a different connection, and without unbinding over the suspension it would find the outer transaction's session still bound and run its work on the wrong connection.

Constructors

Link copied to clipboard
constructor(holder: OctaviusSessionHolder, key: OctaviusSessionKey)

Properties

Link copied to clipboard
open override val order: Int

Functions

Link copied to clipboard
open fun afterCommit()
Link copied to clipboard
open fun afterCompletion(status: Int)
Link copied to clipboard
open fun beforeCommit(readOnly: Boolean)
Link copied to clipboard
open fun beforeCompletion()
Link copied to clipboard
protected open fun cleanupResource(resourceHolder: OctaviusSessionHolder?, resourceKey: OctaviusSessionKey?, committed: Boolean)
Link copied to clipboard
open fun flush()
Link copied to clipboard
protected open fun flushResource(resourceHolder: OctaviusSessionHolder?)
Link copied to clipboard
open override fun getOrder(): Int

Ahead of Spring's own connection synchronization, which releases the connection at DataSourceUtils.CONNECTION_SYNCHRONIZATION_ORDER. Ending the session runs statements on that connection, so it has to come first.

Link copied to clipboard
protected open fun processResourceAfterCommit(resourceHolder: OctaviusSessionHolder?)
Link copied to clipboard
protected open override fun releaseResource(resourceHolder: OctaviusSessionHolder, resourceKey: OctaviusSessionKey)
Link copied to clipboard
open fun resume()
Link copied to clipboard
open fun savepoint(savepoint: Any?)
Link copied to clipboard
open fun savepointRollback(savepoint: Any?)
Link copied to clipboard
protected open fun shouldReleaseAfterCompletion(resourceHolder: OctaviusSessionHolder?): Boolean
Link copied to clipboard
protected open override fun shouldReleaseBeforeCompletion(): Boolean

Moves the release from beforeCompletion, where this class puts it by default, to afterCompletion.

Link copied to clipboard
protected open fun shouldUnbindAtCompletion(): Boolean
Link copied to clipboard
open fun suspend()