Execution Threads and Transactions in Sybase Adaptive Server Setting the Timeout for Detached Transactions Transaction Behavior on Sybase Adaptive Server

10-4 Programming JTA for Oracle WebLogic Server

10.3.2.1 Execution Threads and Transactions in Sybase Adaptive Server

Prior to Adaptive Server version 12.0, all resources of a transaction were privately owned by a single task on the server. The server could not share a transaction with any task other than the one that initiated the transaction. Adaptive Server version 12.x includes support for the suspend and join semantics used by XA-compliant transaction managers such as WebLogic Server. Transactions can be shared among different execution threads, or may not be associated with an execution thread detached.

10.3.2.2 Setting the Timeout for Detached Transactions

On the Sybase server, you can set the dtm detach timeout period, which sets the amount of time in minutes that a distributed transaction branch can remain in the detached state without an associated execution thread. After this period, the DBMS automatically rolls back the transaction. The dtm detach timeout period applies to all transactions on the database server. It cannot be set for each transaction. For example, to automatically rollback transactions after being detached for 10 minutes, use the following command: sp_configure dtm detach timeout period, 10 You should set the dtm detach timeout period higher than the transaction timeout to prevent the database server from rolling back the transaction before the transaction times out in WebLogic Server. For more information about the dtm detach timeout period, see the Sybase documentation.

10.3.2.3 Transaction Behavior on Sybase Adaptive Server

If a global transaction is started on the Sybase server, but is not completed, the outcome of the transaction varies depending on the transaction state before the transaction is abandoned: ■ If the client is terminated before the xa.end call, the transaction is rolled back. ■ If the client is terminated after the xa.end call, the transaction remains on the database server and holds all relevant locks. ■ If an application calls xa.start but has not called xa.end and the application terminates unexpectedly, the database server immediately rolls back the transaction and frees locks held by the transaction. ■ If an application calls xa.start and xa.end and the application terminates unexpectedly, the database server rolls back the transaction and frees locks held by the transaction after the dtm detach timeout period has elapsed. See Section 10.3.2.2, Setting the Timeout for Detached Transactions . ■ If an application calls xa.start and xa.end, and then the transaction is prepared, if the application terminates unexpectedly, the transaction persists so that it can be properly recovered. The Transaction Manager must call rollback or commit to complete the transaction.

10.3.3 Configuration Properties for Java Clients