Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty

This question concerns HTTP routing, not RPC-calls, so the the answer given here:

https://www.odoo.com/forum/help-1/question/how-to-rollback-a-record-if-exception-occurs-47846

does not apply. In writing this application I've noticed that an internal server error (everything from Syntax to Integrity) does NOT trigger a rollback: changes made before the exception are still there. Is there a way, in either Odoo or werkzeug, to easily make HTTP routes "safe", i.e make it so that if any exception occurrs while processing, the cursor is automatically rolled back to a state before the request was received? Wrapping every endpoint in a try/except is the best I've come up with, I was wondering if there was a better way?

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
maalisk. 15
18904
5
helmik. 17
12936
3
elok. 20
10261
0
heinäk. 17
3091
0
helmik. 16
3352