Forum OpenACS Q&A: Is it OK to ad_script_abort inside a db_transaction?

This question came up during development today. I seem to remember someone somewhere saying a long time ago that doing an ad_script_abort within a db_transaction was bad. I even found an old mail from me advising people not to do it, but unfortunately there was no evidence to back it up.

Is this the case? Was it ever the case? Or have I been having OACS dreams again?

Collapse
Posted by Avni Khatri on
Hi Michael -

I don't think you've been having dreams. :)

I don't know if there's a hard and fast rule, but I think the preferred method is to use "db_abort_transaction" within a db_transaction block to abort instead of ad_script abort.

This will abort all levels of a transaction.

Read here under the Basic API (db_transaction) section:
https://openacs.org/doc/db-api.html

Avni