    All Packages    This Package  Previous  Next

# Class sqlj.runtime.profile.ref.TransactionControlProfile

    java.lang.Object
       |
       +----sqlj.runtime.profile.ref.ProfileWrapper
               |
               +----sqlj.runtime.profile.ref.TransactionControlProfile

public class TransactionControlProfile
extends ProfileWrapper

An TransactionControlProfile is a connected profile wrapper which augments the functionality of the statement creation methods by intercepting any entries flagged as COMMIT, ROLLBACK, and SET_TRANSACTION, and handling the execute of such an entry by calling the appropriate method on the underlying connection object.

##

TransactionControlProfile(ConnectedProfile)
  Creates a new transaction control profile that augments the functionality of the passed connected profile.
TransactionControlProfile(ConnectedProfile, boolean, boolean, boolean)
  Creates a new transaction control profile that augments the functionality of the passed connected profile.

##

getStatement(int)
  Returns an executable statement object representing the statement at index "ndx" in the profile, where "ndx" is 0 based.

##

TransactionControlProfile

     public TransactionControlProfile(ConnectedProfile profile)

  Creates a new transaction control profile that augments the functionality of the passed connected profile. All statement types are intercepted.

  Parameters:
    profile - the connected profile to wrap

TransactionControlProfile

     public TransactionControlProfile(ConnectedProfile profile,
                                      boolean handleCommit,
                                      boolean handleRollback,
                                      boolean handleSetTransaction)

  Creates a new transaction control profile that augments the functionality of the passed connected profile.

  Parameters:
    profile - the connected profile to wrap
    handleCommit - true if COMMIT should be intercepted, false otherwise.
    handleRollback - true if ROLLBACK should be intercepted, false otherwise.
    handleSetTransaction - true if SET_TRANSACTION statements should be intercepted, false otherwise.

##

getStatement

     public RTStatement getStatement(int ndx) throws SQLException

  Returns an executable statement object representing the statement at index "ndx" in the profile, where "ndx" is 0 based. If the role of the entry at the given index is not COMMIT, ROLLBACK, or SET_TRANSACTION, the statement is created using the `getStatement` method of the underlying connected profile.

  If the role is COMMIT, the object returned is a statement that, when executed, calls the `commit` method on the connection with which this connected profile was created.

  If the role is ROLLBACK, the object returned is a statement that, when executed, calls the `rollback` method on the connection with which this connected profile was created.

  If the role is SET_TRANSACTION, the object returned is a statement that, when executed, calls the `setTransactionIsolation` and `setReadOnly` methods on the connection with which this connected profile was created, passing values as described in the SetTransactionDescriptor value of the entry.

  It is assumed that COMMIT, ROLLBACK, and SET_TRANSACTION are always handled with PREPARED statements via the executeUpdate method. Moreover, it is assumed that such statements never recieve any input parameters. If the entry info describes otherwise, this method will raise an exception.

  Parameters:
    the - index of the statement to return, 0 based.
  Throws: SQLException
    if an error occurs preparing the statement.
  Overrides:
    getStatement in class ProfileWrapper
  See Also:
    getRole, COMMIT, ROLLBACK, SET_TRANSACTION, getStatementType, getExecuteType, getDescriptor, getTransactionDescriptor

    All Packages    This Package  Previous  Next