Savepoints In Transactions
来源:互联网 发布:matlab solve 矩阵 编辑:程序博客网 时间:2024/05/18 01:48
Savepoints In Transactions
You can declare intermediate markers called savepoints within the context of a transaction. Savepoints divide a long transaction into smaller parts.
Using savepoints, you can arbitrarily mark your work at any point within a long transaction. You then have the option later of rolling back work performed before the current point in the transaction but after a declared savepoint within the transaction. For example, you can use savepoints throughout a long complex series of updates, so if you make an error, you do not need to resubmit every statement.
Savepoints are similarly useful in application programs. If a procedure contains several functions, then you can create a savepoint before each function begins. Then, if a function fails, it is easy to return the data to its state before the function began and re-run the function with revised parameters or perform a recovery action.
After a rollback to a savepoint, Oracle releases the data locks obtained by rolled back statements. Other transactions that were waiting for the previously locked resources can proceed. Other transactions that want to update previously locked rows can do so.
When a transaction is rolled back to a savepoint, the following occurs:
-
Oracle rolls back only the statements run after the savepoint.
-
Oracle preserves the specified savepoint, but all savepoints that were established after the specified one are lost.
-
Oracle releases all table and row locks acquired since that savepoint but retains all data locks acquired previous to the savepoint.
The transaction remains active and can be continued.
Whenever a session is waiting on a transaction, a rollback to savepoint does not free row locks. To make sure a transaction does not hang if it cannot obtain a lock, use FOR
UPDATE
... NOWAIT
before issuing UPDATE
or DELETE
statements. (This refers to locks obtained before the savepoint to which has been rolled back. Row locks obtained after this savepoint are released, as the statements executed after the savepoint have been rolled back completely.)
摘自:
http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14220/transact.htm#sthref602
- Savepoints In Transactions
- Transactions in ODBC
- In-Doubt Transactions
- Transactions
- [OnJava] Wire Hibernate Transactions in Spring
- Getting Ledger transactions in Ax 2012
- How to add a DELAY in applying transactions in GoldenGate?
- Protecting Your Data Integrity with Transactions in ADO.NET
- Distributed transactions in Spring, with and without XA
- Running Distributed Transactions in RAC without DTP service
- Spring JTA multiple resource transactions in Tomcat with Atomikos example
- Spring JTA multiple resource transactions in Tomcat with Atomikos example
- Distributed transactions in Spring, with and without XA
- oracle中的savepoints是什么
- oracle中的savepoints
- (转贴)How to use JDBC and transactions in Tomcat with JOTM
- Using distributed transactions in .Net 1.x without deriving from ServicedComponent
- High Performance Computing in Science and Engineering ' 05 : Transactions of the High Performance Co
- GridView绑定数据源时无记录时也显示表头
- Java学习:多线程(1)
- Spring Web MVC中映射数组及Collection类
- Delphi快捷键大全
- 数据库设计
- Savepoints In Transactions
- PHP新手面试题总100分
- 在C#中使用属性控件添加属性窗口
- vs2005环境重置办法
- ADO和ADO.net与数据库数据类型转换表
- 深入理解C++中的mutable关键字
- SOA:原理•方法•实践,第 1 部分: SOA 的基本概念
- 中秋节到了, 祝大家节日快乐!
- 互联网创业就是属于年轻人的