jcs_odf.begin_transaction

on-site-related topic PL/SQL API jcs_odf.begin_transaction

Summary

Start a thread of action.

All subsequent ODF calls will be committed in a single transaction.

You can choose to use only one transaction simultaneously, as in the following example.

Specification

Copy
procedure begin_transaction(delay_commit in varchar2 default const.jcs_no)

Parameters

  • delay_commit - allow the creation of multiple objects in one transaction without intermediate commit. This is only supported for monitor objects and meant for internal purposes

Using a single transaction thread

Copy

             jcs_odf.begin_transaction;
               t_id := jcs_odf.get_transaction_id;
               jcs_odf.xxxx -- some jcs_odf calls
               jcs_odf.xxxx -- some jcs_odf calls
             jcs_odf.commit_transaction;

Or you can decide to use multiple transactions at the same time.

Using multiple transaction threads

Copy

             jcs_odf.begin_transaction; -- start first thread
               t_id1 := jcs_odf.get_transaction_id;
               jcs_odf.xxxx -- some jcs_odf calls
               jcs_odf.xxxx -- some jcs_odf calls
             jcs_odf.begin_transaction; -- start second thread
               t_id2 := jcs_odf.get_transaction_id;
               jcs_odf.xxxx -- some jcs_odf calls
               jcs_odf.xxxx -- some jcs_odf calls
             jcs_odf.set_transaction_id( t_id1 ); -- resume with thread 1
               jcs_odf.xxxx -- some jcs_odf calls
             jcs_odf.set_transaction_id( t_id2 ); -- resume with thread 2
               jcs_odf.xxxx -- some jcs_odf calls
             jcs_odf.commit_transaction; -- commit and destroy thread 2
             jcs_odf.set_transaction_id( t_id1 ); -- resume with thread 1
               jcs_odf.xxxx -- some jcs_odf calls
             jcs_odf.commit_transaction; -- commit and destroy thread 1

Note: Do not forget to call jcs_odf.commit_transaction or jcs_odf.rollback_transaction otherwise SGA memory will be wasted.

See Also