Skip to content

Transactions

cassiobj edited this page Jun 10, 2024 · 1 revision

Transactions


This topic explans how to use transactions operations.

pcm_open_transaction()

This function opens a transaction in CM according with FLAG parameters.

SYNTAX:

pcm_open_transaction( < pcm op trans flag> , [optional flist])

FLAGS: PCM_TRANS_OPEN_READONLY, PCM_TRANS_OPEN_READWRITE, PCM_TRANS_OPEN_GLOBALTRANSACTION, PCM_TRANS_OPEN_LOCK_OBJ, PCM_TRANS_OPEN_LOCK_DEFAULT

Returns

0 = Sucess
-1 = Error

Example:

import PCMPy

PCMPy.pcm_open_transaction(PCMPy.PCM_TRANS_OPEN_READWRITE);

pcm_abort_transaction()

This funtion close a transaction previously opened with pcm_open_transaction and will rollback all changes made during opened session.

SYNTAX:

pcm_abort_transaction()

Returns

0 = Sucess
-1 = Error

Example:

import PCMPy

PCMPy.pcm_abort_transaction();

pcm_commit_transaction()

This funtion close a transaction previously opened with pcm_open_transaction and will commit all changes made during opened session.

SYNTAX:

pcm_commit_transaction()

Returns

0 = Sucess
-1 = Error

Example:

import PCMPy

PCMPy.pcm_commit_transaction();