Why the call section & SQL(both are mutually exclusive) are not able to use at a time in application engine?

When a SQL is run, there is a lock on the table by the database until that section is completed. If during that time there runs some other process which will use the same table locked by our section using call section, this process will fail.

This is basically to avoid Lock.

Say for example: We execute some DML transaction on Table T1 in SQL action (This is the first Action in a Step of Application Engine Section). If we are trying to do some DML transaction again on Table T1 using Call Section action, this will create a Lock on table T1.


Main Program
SQL - Update T1, set salary = salary * 2.
Call Section - Calc


       Section Calc
       SQL Update T1, set salary = salary *3
       end-section
       (default commit)


Main Program
end-section
(default commit)



Since PS is creating a separate Database Session for these Actions, it is difficult to maintain COMMIT / ROLLBACK transaction controls.

No comments:

Post a Comment