Changes between Version 6 and Version 7 of P8
- Timestamp:
- 05/18/26 21:18:36 (8 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
P8
v6 v7 604 604 }}} 605 605 606 == Isolation Levels ==607 === Overview ===608 Isolation defines how concurrent transactions behave.609 610 Problems prevented:611 612 * Dirty reads613 * Non-repeatable reads614 * Phantom reads615 * Lost updates616 617 === Levels ===618 619 * READ COMMITTED – basic reads620 * REPEATABLE READ – RSVP consistency621 * SERIALIZABLE – full booking + budget validation622 623 === SQLAlchemy ===624 {{{625 db.session.execute(text('SET TRANSACTION ISOLATION LEVEL SERIALIZABLE'))626 }}}627 628 == Connection Pooling ==629 === Why needed ===630 Pooling reuses DB connections instead of creating new ones per request.631 632 606 === Flask Implementation === 633 607 {{{ … … 688 662 === Explanation === 689 663 begin_nested() creates a database savepoint. If the band booking fails, only the operations after the savepoint are rolled back while earlier successful inserts remain intact. 664 665 == Isolation Levels == 666 === Overview === 667 Isolation defines how concurrent transactions behave. 668 669 Problems prevented: 670 671 * Dirty reads 672 * Non-repeatable reads 673 * Phantom reads 674 * Lost updates 675 676 === Levels === 677 678 * READ COMMITTED – basic reads 679 * REPEATABLE READ – RSVP consistency 680 * SERIALIZABLE – full booking + budget validation 681 682 === SQLAlchemy === 683 {{{ 684 db.session.execute(text('SET TRANSACTION ISOLATION LEVEL SERIALIZABLE')) 685 }}} 686 687 == Connection Pooling == 688 === Why needed === 689 Pooling reuses DB connections instead of creating new ones per request. 690 690 691 691 === Affected endpoints ===
