Firebird Tour 2013: seminar “All About Transactions”
Siegburg, November 22, Kranz Park Hotel
Prague, November 25, Hotel Extol Inn
The speakers at the tour are Vlad Khorsun (Firebird Core Team), Alexey Kovyazin (IBSurgeon), Dmitry Kuzmenko, and Pavel Cizar.
||Overview of transactions concept and its parameters. Examples of transactions parameters and their usage.
||Alexey Kovyazin/Pavel Cizar
||Transaction in Firebird: peculiarities and special parameters. Transaction inventory page, versions and how transactions work in multi-generation database.
||Inside Firebird transactions: what happen inside engine during transactions’ start, commit, rollback. What is retaining, autocommit, how transactions work with GTT. Memory consumption for transactions processing.
||Transactions interaction and best practices for application development. Conflicts between transactions.
||Garbage collection mechanism and sweep in details
||Transactions management in various drivers (Delphi, .NET, Java, etc): parameters and approaches.
||Dmitry Kuzmenko/Jiri Cincura
||Diagnosing transaction management problems: most prevalent problems, how to catch and fix them.
||Round table (including Firebird 3.0 QA)
1. Overview of Firebird development
- New features and details of Firebird development,
- Plan for next releases
2. Overview of transactions concept and its parameters. Examples of transactions parameters and their usage.
- Historical overview of transactions: locking engines, dirty read, why Firebird has only snapshot и read_committed
- Transaction as logical operation: bridge between business logic and database implementation
- What is ACID
- Isolation levels: standard levels and Firebird levels
- read only\write
- wait and nowait
- Examples of transactions with various isolation levels, read-only/write and wait/nowait, from the client point of view
3. Transaction in Firebird: peculiarities and special parameters. Transaction inventory page, versions and how transactions work in multi-generation database.
- Full syntax of SET TRANSACTION and TPB parameters
- Some undocumented parameters
- Who create transactions
- System transaction (tx #0)
- Garbage collector
- Autonomous transactions
- Triggers ON CONNECT\ON DISCONNECT
- Versioning basics
- How versions are being created
- States of transaction in Firebird (active, committed, rolled back, limbo)
- Visibility of record versions in transactions
- Key differences between Read Committed and Snapshot
- Triggers for transactions start and stop
- Context variables at transaction’s level
4. Inside Firebird transactions: what happen inside engine during transactions’ start, commit, rollback.
- What happens at transactions’ start
- Global transaction markers (OAT, OST, OIT) and their meaning
- What happens at transaction commit
- How DWF works
- DDL queries
- Dispatching events
- Flush of dirty pages
- TIP processing
- What happens at rollback
- Standard rollback with cache flush
- Forces rollback without cache flush
- Rollback transactions with undo-log
- Rollback without undo-log
- What is retaining
- Auto-commit (does anybody know about it?)
- Managing memory for transactions
- Temporary BLOBs
- Local TIP and related issues
5. Transactions interaction and best practices for application development. Conflicts between transactions.
- Transactions interactions types
- Templates for transaction usage in application development
- Scenarios breakdown: Readers and Readers, Readers and Writers, Writers and Writers
- Best practices
- Splitting read and write transactions
- Locking record with empty Update
- Locking with SELECT WITH LOCK
- Serialization: how to build effective queues
6. Garbage collection mechanism and sweep in details
- Why we need sweep?
- How sweep works
- Types of the sweep: cooperative, background, background
- Differences between sweep and garbage collection
- Autosweep: pro and contras
- Examples of application design mistakes which lead to excessive garbage
7. Transactions management in various drivers (Delphi, .NET, Java, etc): parameters and approaches.
- What are direct and non-direct client drivers?
- BDE, dbExpress, ODBC, .Net
- IBX, FIBPlus, FireDAC
- Transactions management in applications: examples
- How to manage transactions lifetime in various drivers
- How to implement edit dialogs in the effective and safe way
- Commit retaining
8. Diagnosing transaction management problems: most prevalent problems, how to catch and fix them.
- What we can see at gstat -h
- OIT, OST, OAT, NEXT — their combinations and what they mean
- When garbage collection does not work?
- Transaction markers dynamics analysis with IBTM. Catching sweep moments.
- How to determine quantity of garbage versions
- How to find long transactions with MON$ tables
- Transactions monitoring with MON$ and TraceAPI.
- Legacy applications: workarounds for error in transactions management
9. Round table: questions and answers