类 SpringLobCreatorSynchronization
- java.lang.Object
- org.springframework.transaction.support.TransactionSynchronizationAdapter
- org.springframework.jdbc.support.lob.SpringLobCreatorSynchronization
- 所有已实现的接口:
Flushable
,Ordered
,TransactionSynchronization
public class SpringLobCreatorSynchronization extends TransactionSynchronizationAdapter
Callback for resource cleanup at the end of a Spring transaction. InvokesLobCreator.close()
to clean up temporary LOBs that might have been created.- 从以下版本开始:
- 2.0
- 作者:
- Juergen Hoeller
- 另请参阅:
LobCreator.close()
字段概要
字段 修饰符和类型 字段 说明 static int
LOB_CREATOR_SYNCHRONIZATION_ORDER
Order value for TransactionSynchronization objects that clean up LobCreators.从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
从接口继承的字段 org.springframework.transaction.support.TransactionSynchronization
STATUS_COMMITTED, STATUS_ROLLED_BACK, STATUS_UNKNOWN
构造器概要
构造器 构造器 说明 SpringLobCreatorSynchronization(LobCreator lobCreator)
Create a SpringLobCreatorSynchronization for the given LobCreator.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterCompletion(int status)
Invoked after transaction commit/rollback.void
beforeCompletion()
Invoked before transaction commit/rollback.int
getOrder()
Get the order value of this object.从类继承的方法 org.springframework.transaction.support.TransactionSynchronizationAdapter
afterCommit, beforeCommit, flush, resume, suspend
字段详细资料
LOB_CREATOR_SYNCHRONIZATION_ORDER
public static final int LOB_CREATOR_SYNCHRONIZATION_ORDER
Order value for TransactionSynchronization objects that clean up LobCreators. Return CONNECTION_SYNCHRONIZATION_ORDER - 200 to execute LobCreator cleanup before Hibernate Session (- 100) and JDBC Connection cleanup, if any.
构造器详细资料
SpringLobCreatorSynchronization
public SpringLobCreatorSynchronization(LobCreator lobCreator)
Create a SpringLobCreatorSynchronization for the given LobCreator.- 参数:
lobCreator
- the LobCreator to close after transaction completion
方法详细资料
getOrder
public int getOrder()
从接口复制的说明:Ordered
Get the order value of this object.Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet
load-on-startup
values).Same order values will result in arbitrary sort positions for the affected objects.
- 指定者:
getOrder
在接口中Ordered
- 覆盖:
getOrder
在类中TransactionSynchronizationAdapter
- 返回:
- the order value
- 另请参阅:
Ordered.HIGHEST_PRECEDENCE
,Ordered.LOWEST_PRECEDENCE
beforeCompletion
public void beforeCompletion()
从接口复制的说明:TransactionSynchronization
Invoked before transaction commit/rollback. Can perform resource cleanup before transaction completion.This method will be invoked after
beforeCommit
, even whenbeforeCommit
threw an exception. This callback allows for closing resources before transaction completion, for any outcome.
afterCompletion
public void afterCompletion(int status)
从接口复制的说明:TransactionSynchronization
Invoked after transaction commit/rollback. Can perform resource cleanup after transaction completion.NOTE: The transaction will have been committed or rolled back already, but the transactional resources might still be active and accessible. As a consequence, any data access code triggered at this point will still "participate" in the original transaction, allowing to perform some cleanup (with no commit following anymore!), unless it explicitly declares that it needs to run in a separate transaction. Hence: Use
PROPAGATION_REQUIRES_NEW
for any transactional operation that is called from here.- 指定者:
afterCompletion
在接口中TransactionSynchronization
- 覆盖:
afterCompletion
在类中TransactionSynchronizationAdapter
- 参数:
status
- completion status according to theSTATUS_*
constants- 另请参阅:
TransactionSynchronization.STATUS_COMMITTED
,TransactionSynchronization.STATUS_ROLLED_BACK
,TransactionSynchronization.STATUS_UNKNOWN
,TransactionSynchronization.beforeCompletion()