Oracle Fusion Middleware
Oracle WebLogic Server API Reference
11g Release 1 (10.3.4)

Part Number E13941-04

weblogic.transaction
Interface ClientTransactionManager

All Known Subinterfaces:
ServerTransactionManager, TransactionManager

public interface ClientTransactionManager

Allows a transaction to be suspended and resumed. This is separate from weblogic.trasnaction.TransactionManager so that it can be used in the thin-client.


Method Summary
 void forceResume(Transaction suspendedTx)
          If the transaction is active, resume automatically enlists statically registered resources and associates the transaction with the thread.
 Transaction forceSuspend()
          suspend dissociates the transaction from the thread delists enlisted resources and marks the transaction for rollback in the event of any failures (for example, while delisting statically registered resources).
 

Method Detail

forceResume

void forceResume(Transaction suspendedTx)
If the transaction is active, resume automatically enlists statically registered resources and associates the transaction with the thread. It also checks to see if there's another transaction associated with the thread.

forceResume simply associates a transaction with a thread without further ado. It is used when you want to suspend a transaction in a thread and subsequently resume it without checking the state. This call is typically used by XA resource providers. Caution must be exercised when using this method because it bypasses all the sanity checks otherwise performed by resume.

The following example illustrates its use. Say, you want to make an RMI or JDBC call (or simply a call to a local object) without propagating the transaction, while ensuring that code after the RMI call sees the transaction in its original state. The following code illustrates the use of forceResume:

 import weblogic.transaction.TransactionManager;
 import weblogic.transaction.Transaction;

 TransactionManager tm = TxHelper.getTransaction();
 Transaction saveTx = null;
 try {
   saveTx = tm.forceSuspend();
    .. make non-transactional call ...
 } finally {
   tm.forceResume(saveTx);
 }
 

Weblogic rmi supports a marker interface called "NonTransactionRemote" and an rmi compiler option "-nontransactional". For those remote interfaces extending this interface (or by using the rmic command-line option) the complier inserts this boiler-plate code in the RMI stub.

See Also:


forceSuspend

Transaction forceSuspend()
suspend dissociates the transaction from the thread delists enlisted resources and marks the transaction for rollback in the event of any failures (for example, while delisting statically registered resources). forceSuspend merely dissociates the transaction from the thread; it doesn't delist resources, nor does it throw any exceptions.


Copyright 1996, 2010, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Oracle Fusion Middleware
Oracle WebLogic Server API Reference
11g Release 1 (10.3.4)

Part Number E13941-04