Transaction Engine used in sub transactions.
| 575 | ctx.rollback() |
| 576 | |
| 577 | class subtransaction_engine: |
| 578 | """Transaction Engine used in sub transactions.""" |
| 579 | |
| 580 | def query(self, q): |
| 581 | db_cursor = ctx.db.cursor() |
| 582 | ctx.db_execute(db_cursor, SQLQuery(q % transaction_count)) |
| 583 | |
| 584 | def do_transact(self): |
| 585 | self.query("SAVEPOINT webpy_sp_%s") |
| 586 | |
| 587 | def do_commit(self): |
| 588 | self.query("RELEASE SAVEPOINT webpy_sp_%s") |
| 589 | |
| 590 | def do_rollback(self): |
| 591 | self.query("ROLLBACK TO SAVEPOINT webpy_sp_%s") |
| 592 | |
| 593 | class dummy_engine: |
| 594 | """Transaction Engine used instead of subtransaction_engine |