Isolation levels, savepoints, and rollbacks

PostgreSQL में Transactions और Error Handling

Jason Myers

Instructor

Isolation Levels

Isolation Level Dirty Read Nonrepeatable Read Phantom Read Serialization Anomaly
Read Uncommitted Protected (PostgreSQL) vulnerable vulnerable vulnerable
Read Committed Protected vulnerable vulnerable vulnerable
Repeatable Read Protected Protected Protected (PostgreSQL) vulnerable
Serializable Protected Protected Protected Protected
PostgreSQL में Transactions और Error Handling

Repeatable Read

  • SERIALIZABLE

    • सभी committed transactions के लिए serial execution जैसा व्यवहार करता है.
  • REPEATABLE READ

    • यह डेटा देखता है
      • जो transaction शुरू होने से पहले committed था
      • transaction में पिछली statements के परिणाम
    • concurrent transactions द्वारा committed कोई बदलाव नहीं देखता.
PostgreSQL में Transactions और Error Handling

REPEATABLE READ को विज़ुअलाइज़ करना

REPEATABLE READ का डायग्राम

PostgreSQL में Transactions और Error Handling

REPEATABLE READ को विज़ुअलाइज़ करना

REPEATABLE READ का डायग्राम

PostgreSQL में Transactions और Error Handling

REPEATABLE READ को विज़ुअलाइज़ करना

REPEATABLE READ का डायग्राम

PostgreSQL में Transactions और Error Handling

REPEATABLE READ

START TRANSACTION ISOLATION LEVEL REPEATABLE READ;

UPDATE inventory SET quantity = quantity - 4 WHERE name = 'macaron'; SAVEPOINT first;
UPDATE inventory SET quantity = quantity - 12 SAVEPOINT second; COMMIT;
PostgreSQL में Transactions और Error Handling

अभ्यास करते हैं!

PostgreSQL में Transactions और Error Handling

Preparing Video For Download...