Understanding COM+ Transactions

This code outline explains how to develop code for COM connector and JD Edwards EnterpriseOne participation in COM+ transactions:

Code

Explanation

Dim ow As OneWorldTx

Declare new OneWorldTx.

Set ow = New OneWorldTx

ow.Initialize laccessNumber, connRole

Initialize the transaction by passing the access number returned from a successful logon and the connector.

ow.BeginTransaction laccessNumber, connRole, 1

Start a transaction in Manual Commit.

1 Manual commit

0 Auto Commit

EditLine, EndDoc

Do all the processing here like BeginDoc.

GetObjectContext().SetComplete

or

GetObjectContext().SetAbort

Use SetComplete to commit the transaction through DTC

or

use SetAbort to abort the transaction.

Note: In COM+, an AutoCommit attribute exists that implicitly commits a transaction if no errors exist. This attribute is in the Component Services Administration tool. However, if an explicit call to SetAbort is made, the transaction aborts.

These code examples illustrate how to create a sales order entry transactional object (SOETxObject) and a sales order entry transactional client (SOETxClient). After you create the transactional object and transactional client, you can run the transactions. Use these steps to run a sales order entry transaction in COM+ where the COM connector and JD Edwards EnterpriseOne participate:

  1. Run the SOETxObject.

  2. Run the SOETxClient.

  3. Note the Sales Order Entry number that is displayed.

  4. When the message box appears for Commit or Abort, select the appropriate action.

  5. Verify in JD Edwards EnterpriseOne whether the sales order has been entered. The sales order should be entered only when committed.