public abstract class

DelegatingTransactionDefinition

extends Object
implements Serializable TransactionDefinition
java.lang.Object
   ↳ org.springframework.transaction.support.DelegatingTransactionDefinition
Known Direct Subclasses

Class Overview

TransactionDefinition implementation that delegates all calls to a given target TransactionDefinition instance. Abstract because it is meant to be subclassed, with subclasses overriding specific methods that are not supposed to simply delegate to the target instance.

Summary

[Expand]
Inherited Constants
From interface org.springframework.transaction.TransactionDefinition
Public Constructors
DelegatingTransactionDefinition(TransactionDefinition targetDefinition)
Create a DelegatingTransactionAttribute for the given target attribute.
Public Methods
boolean equals(Object obj)
int getIsolationLevel()
Return the isolation level.
String getName()
Return the name of this transaction.
int getPropagationBehavior()
Return the propagation behavior.
int getTimeout()
Return the transaction timeout.
int hashCode()
boolean isReadOnly()
Return whether to optimize as a read-only transaction.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.transaction.TransactionDefinition

Public Constructors

public DelegatingTransactionDefinition (TransactionDefinition targetDefinition)

Create a DelegatingTransactionAttribute for the given target attribute.

Public Methods

public boolean equals (Object obj)

public int getIsolationLevel ()

Return the isolation level.

Must return one of the ISOLATION_XXX constants defined on this interface.

Only makes sense in combination with PROPAGATION_REQUIRED or PROPAGATION_REQUIRES_NEW.

Note that a transaction manager that does not support custom isolation levels will throw an exception when given any other level than ISOLATION_DEFAULT.

Returns
  • the isolation level

public String getName ()

Return the name of this transaction. Can be null.

This will be used as the transaction name to be shown in a transaction monitor, if applicable (for example, WebLogic's).

In case of Spring's declarative transactions, the exposed name will be the fully-qualified class name + "." + method name (by default).

Returns
  • the name of this transaction

public int getPropagationBehavior ()

Return the propagation behavior.

Must return one of the PROPAGATION_XXX constants defined on this interface.

Returns
  • the propagation behavior

public int getTimeout ()

Return the transaction timeout.

Must return a number of seconds, or TIMEOUT_DEFAULT.

Only makes sense in combination with PROPAGATION_REQUIRED or PROPAGATION_REQUIRES_NEW.

Note that a transaction manager that does not support timeouts will throw an exception when given any other timeout than TIMEOUT_DEFAULT.

Returns
  • the transaction timeout

public int hashCode ()

public boolean isReadOnly ()

Return whether to optimize as a read-only transaction.

The read-only flag applies to any transaction context, whether backed by an actual resource transaction (PROPAGATION_REQUIRED/PROPAGATION_REQUIRES_NEW) or operating non-transactionally at the resource level (PROPAGATION_SUPPORTS). In the latter case, the flag will only apply to managed resources within the application, such as a Hibernate Session. << *

This just serves as a hint for the actual transaction subsystem; it will not necessarily cause failure of write access attempts. A transaction manager which cannot interpret the read-only hint will not throw an exception when asked for a read-only transaction.

Returns
  • true if the transaction is to be optimized as read-only

public String toString ()