org.springframework.orm.ibatis.support
Class AbstractLobTypeHandler.LobCreatorSynchronization

java.lang.Object
  extended by org.springframework.transaction.support.TransactionSynchronizationAdapter
      extended by org.springframework.orm.ibatis.support.AbstractLobTypeHandler.LobCreatorSynchronization
All Implemented Interfaces:
Ordered, TransactionSynchronization
Enclosing class:
AbstractLobTypeHandler

private static class AbstractLobTypeHandler.LobCreatorSynchronization
extends TransactionSynchronizationAdapter

Callback for resource cleanup at the end of a Spring transaction. Invokes LobCreator.close to clean up temporary LOBs that might have been created.

See Also:
LobCreator.close()

Field Summary
private  LobCreator lobCreator
           
 
Fields inherited from interface org.springframework.transaction.support.TransactionSynchronization
STATUS_COMMITTED, STATUS_ROLLED_BACK, STATUS_UNKNOWN
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
AbstractLobTypeHandler.LobCreatorSynchronization(LobCreator lobCreator)
           
 
Method Summary
 void beforeCompletion()
          Invoked before transaction commit/rollback.
 int getOrder()
          Return the order value of this object, with a higher value meaning greater in terms of sorting.
 
Methods inherited from class org.springframework.transaction.support.TransactionSynchronizationAdapter
afterCommit, afterCompletion, beforeCommit, flush, resume, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lobCreator

private final LobCreator lobCreator
Constructor Detail

AbstractLobTypeHandler.LobCreatorSynchronization

public AbstractLobTypeHandler.LobCreatorSynchronization(LobCreator lobCreator)
Method Detail

getOrder

public int getOrder()
Description copied from interface: Ordered
Return the order value of this object, with a higher value meaning greater in terms of sorting.

Normally starting with 0, with Integer.MAX_VALUE indicating the greatest value. Same order values will result in arbitrary positions for the affected objects.

Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).

Specified by:
getOrder in interface Ordered
Overrides:
getOrder in class TransactionSynchronizationAdapter
Returns:
the order value

beforeCompletion

public void beforeCompletion()
Description copied from interface: TransactionSynchronization
Invoked before transaction commit/rollback. Can perform resource cleanup before transaction completion.

This method will be invoked after beforeCommit, even when beforeCommit threw an exception. This callback allows for closing resources before transaction completion, for any outcome.

Specified by:
beforeCompletion in interface TransactionSynchronization
Overrides:
beforeCompletion in class TransactionSynchronizationAdapter
See Also:
TransactionSynchronization.beforeCommit(boolean), TransactionSynchronization.afterCompletion(int)