Previous Topic

Book Contents

Book Index

Next Topic

Getting Transactions

There are methods that help you identify the transaction in which the object/catalog was created.

ApiCatalog.getTransaction(), ApiBOBject.getTransaction()

Returns the transaction in which the catalog/the BO was created. This way you can determine the transaction in which the catalogue was created, even though the transaction is an internal one.

Note: when creating catalogs in a short script, you can avoid creating user transaction by getting the internal one, which is created automatically together with the catalog. This enables you to carry out all transaction-related commands and save changes made to the catalog on a single line of code:

ApiCatalog.getTransaction.doCommit()

However, we discourage you from using getTransaction for general purposes. You should only use it in case of solving problems or within a very short portion of code where creating a new transaction would extend the code unnecessarily. Generally, we advise you to stick to using user transactions instead of the internal ones.

See Also

Working in Transactions

Creating Transactions

Registering Objects to Transactions

Working with Objects in Transactions

Committing Transactions

Undoing Changes and Aborting Transactions

Propagating Changes

Calling Workflows on Certain Events