Java Doc for LogicalUndo.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » iapi » store » access » conglomerate » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » db derby 10.2 » org.apache.derby.iapi.store.access.conglomerate 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.derby.iapi.store.access.conglomerate.LogicalUndo

All known Subclasses:   org.apache.derby.impl.store.access.btree.index.B2IUndo,
LogicalUndo
public interface LogicalUndo (Code)
A Logical undo is an undo operation that operates on a different page from the page that has the original change. The reason one would need logical undo is when an uncommitted row move from one page to another in a nested internal transaction which is committed. For example, an uncommitted insert on a btree may be moved by a later split operation to another page, the split operation will have committed. If the insert needs to be rolled back, it can only be found at the new page where the split puts it and not at the original page where it is inserted.

The logging and recovery system does not know how to do logical undo. Client of the logging system must provide it with a call back function so that during undo time (both runtime undo and recovery undo), the appropriate page and row can be found so that the logging system can apply the log's undo operation.

Any log operation that needs logical undo must implement this LogicalUndo interface, which serves the purpose of a callback function pointer. This callback function findUndoInfo is called by log operation generateUndo and will be given all the information in the log operation.

FindUndo uses the information in the pageOp to find the correct page and record that needs to be rolled back, i.e., a latched page (undoPage) and the recordId (undoRID). It returns the latched undoPage, and modifies the pageOp to contain the correct segmentId, containerId, pageNumber and recordId etc. It also need to supply a releaseResource() method that the logging system can call to unlatch the page and release the container, etc, after the undo has been applied.

The logging system will use the information in the undoPackage to put together a Compensation operation which has the undoPage number and undoRID. Logical Undo is only called during the generation of a CLR, never during recovery redo.

Note: LogicalUndo is a call back function pointer that will be written out as part of the log operation, it should not contain any non-transient member fields

Details.

LogicalUndo, and LogicalUndoable is the interface used by logical undo between the logging system in RawStore and Access. A log operation that needs logical undo should implment LogicalUndoable intead of Undoable. A LogicalUndoable log operation contains a LogicalUndo member field, which is a function pointer to an Access function that provides the logical undo logic of, say, traversing a btree.

When called to generateUndo, that LogicalUndoable log operation will call LogicalUndo.findUndo instead of relying on the page number and recordId that is stored in it during the runtime roll forward operation. The logging system opens the container before it calls findUndo, therefore the container where the log operation is applied cannot between rollforward and rollback.

In LogicalUndo.findUndo, it can use information stored in the LogicalUndoable, such as pageNumber, containerId, to come up with a template row. It can then ask the LogicalUndoable log record to restore a row from the log record that fits the template. Using this restored row, LogicalUndo can, e.g., restore the key to the btree and traverses the btree. Once it finds the correct RecordHandle where the rollback should go, findUndo should call pageOp.resetRecord and return a latched page where the undo should go.

Upon the return of findUndo, the LogicalUndoable log operation should have information about the new RecordHandle and the page should be return latched. A compensation operation is then generated with the new record location and undoMe is applied on the correct location.

The logging system will unlatch the undoPage when it is done with rollback and will close the container.
See Also:   org.apache.derby.iapi.store.raw.LogicalUndoable
See Also:   org.apache.derby.iapi.store.raw.Undoable.generateUndo
See Also:   





Method Summary
public  PagefindUndo(Transaction transaction, LogicalUndoable pageOp, LimitObjectInput in)
     Find the page and record to undo.



Method Detail
findUndo
public Page findUndo(Transaction transaction, LogicalUndoable pageOp, LimitObjectInput in) throws StandardException, IOException(Code)
Find the page and record to undo. If no logical undo is necessary, i.e., row has not moved, then just return the latched page where undo should go. If the record has moved, it has a new recordId on the new page, this routine needs to call pageOp.resetRecord with the new RecordHandle so that the logging system can update the compensation Operation with the new location.
Parameters:
  transaction - the transaction doing the rollback
Parameters:
  pageOp - the page operation that supports logical undo. ThisLogicalUndo function pointer is a field of that pageOperation
Parameters:
  in - data stored in the log stream that contains the record datanecessary to restore the row.
exception:
  StandardException - Standard Cloudscape error policy
exception:
  IOException - Method may read from InputStream



w__ww___.__j__a___v___a__2___s_.___co_m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.