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
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
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
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
- jcs_odf.get_transaction_id
- jcs_odf.set_transaction_id
- jcs_odf.commit_transaction
- jcs_odf.rollback_transaction
plsqlTopic
onsiteTopic