Features rollback-only support for participating transactions. Can expire after a certain number of seconds or milliseconds in order to determine a transactional timeout.
org.springframework.jdbc.datasource.DataSourceTransactionManager#doBegin , org.springframework.jdbc.datasource.DataSourceUtils#applyTransactionTimeout
| Modifier and Type | Field and Description |
|---|---|
| private Date | |
| private boolean | |
| private int | |
| private boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | checkTransactionTimeout(boolean deadlineReached)
Set the transaction rollback-only if the deadline has been reached, and throw a TransactionTimedOutException. |
| public void | |
| public Date | |
| public long | Returns: number of milliseconds until expirationReturn the time to live for this object in milliseconds. |
| public int | Returns: number of seconds until expirationReturn the time to live for this object in seconds. |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | isVoid()
Implements org. |
| public void | released()
Decrease the reference count by one because the holder has been released (i.e. someone released the resource held by it). |
| public void | requested()
Increase the reference count by one because the holder has been requested (i.e. someone requested the resource held by it). |
| public void | reset()
Implements org. |
| public void | |
| public void | |
| public void | setSynchronizedWithTransaction(boolean synchronizedWithTransaction)
Mark the resource as synchronized with a transaction. |
| public void | setTimeoutInMillis(long
number of milliseconds until expiration millis)Set the timeout for this object in milliseconds. |
| public void | setTimeoutInSeconds(int
number of seconds until expiration seconds)Set the timeout for this object in seconds. |
| public void | unbound()
Implements org. |
| deadline | back to summary |
|---|---|
| private Date deadline
| |
| isVoid | back to summary |
|---|---|
| private boolean isVoid | |
| referenceCount | back to summary |
|---|---|
| private int referenceCount | |
| rollbackOnly | back to summary |
|---|---|
| private boolean rollbackOnly | |
| synchronizedWithTransaction | back to summary |
|---|---|
| private boolean synchronizedWithTransaction | |
| ResourceHolderSupport | back to summary |
|---|---|
| public ResourceHolderSupport() | |
| checkTransactionTimeout | back to summary |
|---|---|
| private void checkTransactionTimeout(boolean deadlineReached) throws TransactionTimedOutException Set the transaction rollback-only if the deadline has been reached, and throw a TransactionTimedOutException. | |
| clear | back to summary |
|---|---|
| public void clear() Clear the transactional state of this resource holder. | |
| getDeadline | back to summary |
|---|---|
| public Date getDeadline() Return the expiration deadline of this object. | |
| getTimeToLiveInMillis | back to summary |
|---|---|
| public long getTimeToLiveInMillis() throws TransactionTimedOutException Return the time to live for this object in milliseconds.
| |
| getTimeToLiveInSeconds | back to summary |
|---|---|
| public int getTimeToLiveInSeconds() Return the time to live for this object in seconds. Rounds up eagerly, e.g. 9.00001 still to 10.
| |
| hasTimeout | back to summary |
|---|---|
| public boolean hasTimeout() Return whether this object has an associated timeout. | |
| isOpen | back to summary |
|---|---|
| public boolean isOpen() Return whether there are still open references to this holder. | |
| isRollbackOnly | back to summary |
|---|---|
| public boolean isRollbackOnly() Return whether the resource transaction is marked as rollback-only. | |
| isSynchronizedWithTransaction | back to summary |
|---|---|
| public boolean isSynchronizedWithTransaction() Return whether the resource is synchronized with a transaction. | |
| isVoid | back to summary |
|---|---|
| public boolean isVoid() Implements org. Doc from org. Determine whether this holder is considered as 'void', i.e. as a leftover from a previous thread.
| |
| released | back to summary |
|---|---|
| public void released() Decrease the reference count by one because the holder has been released (i.e. someone released the resource held by it). | |
| requested | back to summary |
|---|---|
| public void requested() Increase the reference count by one because the holder has been requested (i.e. someone requested the resource held by it). | |
| reset | back to summary |
|---|---|
| public void reset() Implements org. Reset this resource holder - transactional state as well as reference count.
| |
| resetRollbackOnly | back to summary |
|---|---|
| public void resetRollbackOnly() Reset the rollback-only status for this resource transaction. Only really intended to be called after custom rollback steps which keep the original resource in action, e.g. in case of a savepoint.
| |
| setRollbackOnly | back to summary |
|---|---|
| public void setRollbackOnly() Mark the resource transaction as rollback-only. | |
| setSynchronizedWithTransaction | back to summary |
|---|---|
| public void setSynchronizedWithTransaction(boolean synchronizedWithTransaction) Mark the resource as synchronized with a transaction. | |
| setTimeoutInMillis | back to summary |
|---|---|
| public void setTimeoutInMillis(long millis) Set the timeout for this object in milliseconds.
| |
| setTimeoutInSeconds | back to summary |
|---|---|
| public void setTimeoutInSeconds(int seconds) Set the timeout for this object in seconds.
| |
| unbound | back to summary |
|---|---|
| public void unbound() Implements org. Doc from org. Notify this holder that it has been unbound from transaction synchronization.
| |