Nested transaction
A nested transaction is a database transaction that is started by an instruction within the scope of an already started transaction.
Nested transactions are implemented differently in different databases. However, they have in common that the changes are not made visible to any unrelated transactions until the outermost transaction has committed. This means that a commit in an inner transaction does not necessarily persist updates to the system.
In some databases, changes made by the nested transaction are not seen by the 'host' transaction until the nested transaction is committed. According to some,[who?] this follows from the isolation property of transactions.
The capability to handle nested transactions properly is a prerequisite for true component-based application architectures. In a component-based encapsulated architecture, nested transactions can occur without the programmer knowing it. A component function may or may not contain a database transaction (this is the encapsulated secret of the component. See Information hiding). If a call to such a component function is made inside a BEGIN - COMMIT bracket, nested transactions occur. Since popular databases like MySQL[1] do not allow nesting BEGIN - COMMIT brackets, a framework or a transaction monitor is needed to handle this. When we speak about nested transactions, it should be made clear that this feature is DBMS dependent and is not available for all databases.
Theory for nested transactions is similar to the theory for flat transactions.[2]
The banking industry usually processes financial transactions using open nested transactions,[citation needed] which is a looser variant of the nested transaction model that provides higher performance while accepting the accompanying trade-offs of inconsistency.[3]
Further reading
- Gerhard Weikum, Gottfried Vossen, Transactional information systems: theory, algorithms, and the practice of concurrency control and recovery, Morgan Kaufmann, 2002, ISBN 1-55860-508-8
References
- ^ "Statements That Cause an Implicit Commit". MySQL 4.1 Reference Manual. Oracle. Retrieved 5 December 2010.
- ^ Resende, R.F.; El Abbadi, A. (1994-05-25). "On the serializability theorem for nested transactions". Information Processing Letters. 50 (4): 177–183. CiteSeerX 10.1.1.43.6470. doi:10.1016/0020-0190(94)00033-6.
- ^ Weikum, Gerhard; Hans-J. Schek (1992). Concepts and Applications of Multilevel Transactions and Open Nested Transactions. Morgan Kaufmann. pp. 515–553. CiteSeerX 10.1.1.17.7962. ISBN 978-1-55860-214-4.
{{cite book}}:|journal=ignored (help)
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.