This is the problem. A and B were developed for Oracle where SELECT does not open a transaction. We moved them to PG and now we have to very accurately add COMMITs without breaking the flow. It is quite a complex thing. I hoped we can avoid that.
Interesting. Are you telling the Oracle version of the code had no intermittent COMMIT and relied on one final COMMIT at the end. Even in Oracle developers must have planned for commit since a long running open transaction can lead to “snapshot too old” error.