pradeepcr
10th January 2022, 15:57
Hi All,
I developed a new session which is a multi-occurrence session showing the records from the main table tdpur045. I need to update certain fields on multiple records and the values have to be updated in the main table. I tried using continue button but the functionality does not work and I get an error "Transaction is on, cannot continue". Why do I get this error?
Thanks
OmeLuuk
25th January 2022, 11:43
In the flow of the 4GL (see programmers manual) standard program there are two main branches:
One in the while true loop that builds a transaction. In this you can add your code in the right place and it will be included in the main transaction. In that case do not use a db.retry.point(). When STP hits your db.retry.point but has an uncommitted change, the "Transaction is on, cannot continue" error pops up. This is caused by the fact that when any update fails in this transaction, the whole transaction (all the updates) is rolled back. STP will handle the db.retry.point and commit.transaction.
Note: When your transaction has to follow the 4GL main transaction but is not linked, you can move it to the after.update.db.commit section or in the DAL to the after.commit.transaction hook which is called after the after.update.db.commit section. In both cases you will need to make an extra transaction (with your own db.retry.point and commit.transaction).
In the flow of STP there is also a branch without its own transaction, like the ones in the Form Commands or DAM. There you can add your own transaction.
I hope this gave you enough to know where you caused the transaction is on message. It requires quite a bit insight in the flow of the 4GL standard program, but once you see what is going on, things will become easier to anticipate.