Rollback and $undowork
Paul Mulroney
pmulroney at logicaldevelopments.com.au
Wed Jul 13 01:54:14 UTC 2022
Hi Das,
If you're using transactions in SQL, then you need to do a $commit at the end to commit the changes, or $rollback to undo the changes. There is no $undowork().
By default I think transactions are automatic ie each individual update is committed automatically.
Therefore you need to turn off automatic transactions before you start (calculate session.$transactionmode as kSessionTranManual), have a "do session.$begin()", then "do list.$dowork()" then either "do session.$commit()" or "do session.$rollback()" at the end to either accept or reject the changes. (where session = the session object you're using, and list is the list defined from a table or schema class)
We don't use transactions, but if we did it would look something like that.
Hope this helps.
Regards,
Paul.
> On 13 Jul 2022, at 6:26 am, Das Goravani <goravanis at gmail.com> wrote:
>
>
>
> Dear List,
>
> I can’t figure this out and nowhere is this covered…
>
> If you have a SQL Transaction going, and you are some ways through it, and you have done a $dowork command on a certain list, and you have to rollback, do you ALSO issue $undowork?
>
> Said another way, if you $dowork in a transaction, and you rollback, do you need to do $undowork?
>
> Thanks,
>
> Das Goravani
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
Fishing is a matter of Bait and Sea @gingermeggs1921
--
Paul W. Mulroney We Don't Do Simple Pty Ltd
pmulroney at logicaldevelopments.com.au Trading as Logical Developments
www.logicaldevelopments.com.au ACN 161 009 374
Ph: +61 8 9458 3889 86 Coolgardie Street
BENTLEY WA 6102
More information about the omnisdev-en
mailing list