Java Doc for RawTransaction.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » iapi » store » raw » xact » 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.raw.xact 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.util.Observable
      org.apache.derby.iapi.store.raw.xact.RawTransaction

All known Subclasses:   org.apache.derby.impl.store.raw.xact.Xact,
RawTransaction
abstract public class RawTransaction extends Observable implements Transaction(Code)
RawTransaction is the form of Transaction used within the raw store. This allows the break down of RawStore functionality into (at least) three modules (Transactions, Data, Log) without exposing internal information on the external interface.

The transaction will notify any Observer's just before the transaction is committed, aborted or a rollback to savepoint occurs. The argument passed to the update() method of the Observer's will be one of

  • RawTransaction.COMMIT - transaction is committing
  • RawTransaction.ABORT - transaction is aborting
  • RawTransaction.SAVEPOINTROLLBACK - transaction is being rolled back to a savepoint
The observer's must perform a value equality check (equals()) on the update arg to see why it is being notified.
See Also:   java.util.Observer


Field Summary
final public static  IntegerABORT
    
final public static  IntegerCOMMIT
    
final public static  IntegerLOCK_ESCALATE
    
final public static  IntegerSAVEPOINT_ROLLBACK
    
protected  StandardExceptionobserverException
    


Method Summary
abstract public  voidaddUpdateTransaction(int transactionStatus)
    
abstract public  booleanblockBackup(boolean wait)
    
public  voidcheckLogicalOperationOk()
     Check to see if a logical operation is allowed by this transaction, throws a TransactionExceotion if it isn't.
abstract public  voidcheckpointInRollForwardRecovery(LogInstant cinstant, long redoLWM)
    
abstract public  long[]getCacheStats(String cacheName)
    
abstract public  DataFactorygetDataFactory()
     Get the data factory to be used during this transaction.
abstract public  LogInstantgetFirstLogInstant()
     Get the log instant for the first log record written by this transaction.
abstract public  GlobalTransactionIdgetGlobalId()
     Get the shortId of this transaction.
abstract public  TransactionIdgetId()
     Get the shortId of this transaction.
abstract public  LogInstantgetLastLogInstant()
     Get the log instant for the last log record written by this transaction.
abstract public  LockFactorygetLockFactory()
     Get the lock factory to be used during this transaction.
abstract public  DynamicByteArrayOutputStreamgetLogBuffer()
     Get the log buffer to be used during this transaction.
abstract public  booleanhandlesPostTerminationWork()
    
abstract public  booleaninAbort()
     Is the transaction in the middle of an abort.
abstract public  booleaninRollForwardRecovery()
    
abstract public  booleanisBlockingBackup()
    
abstract public  voidlogAndUndo(Compensation compensation, LogInstant undoInstant, LimitObjectInput in)
     Log a compensation operation and then action it in the context of this transaction. The CompensationOperation is logged in the transaction log file and then its doMe method is called to perform the required change.
public  voidnotifyObservers(Object arg)
     Allow my users to notigy my observers.
abstract public  RawContainerHandleopenDroppedContainer(ContainerKey containerId, LockingPolicy locking)
     Open a container that may be dropped - use only by logging and recovery. During recovery redo, a log record may refer to a container that has long been dropped.
abstract public  voidprepareTransaction()
     Change the state of transaction in table to prepare.
abstract public  voidreCreateContainerForRedoRecovery(long segmentId, long containerId, ByteArray containerInfo)
     Recreate a container during redo recovery.
public  booleanrecoveryRollbackFirst()
     Return true if this transaction should be rolled back first in recovery.
abstract public  voidrecoveryTransaction()
    
abstract public  voidremoveUpdateTransaction()
    
abstract public  voidreprepare()
     During recovery re-prepare a transaction.

After redo() and undo(), this routine is called on all outstanding in-doubt (prepared) transactions.

abstract public  voidresetCacheStats(String cacheName)
    
abstract public  voidsetFirstLogInstant(LogInstant instant)
     Set the log instant for the first log record written by this transaction.
abstract public  voidsetLastLogInstant(LogInstant instant)
     Set the log instant for the last log record written by this transaction.
public  voidsetObserverException(StandardException se)
     Allow an Observer to indicate an exception to the transaction that is raised in its update() method.
abstract public  voidsetTransactionId(GlobalTransactionId id, TransactionId shortId)
    
abstract public  voidsetTransactionId(Loggable beginXact, TransactionId shortId)
    
abstract public  RawTransactionstartNestedTopTransaction()
     Start a nested top transaction.
abstract protected  intstatusForBeginXactLog()
    
abstract protected  intstatusForEndXactLog()
    

Field Detail
ABORT
final public static Integer ABORT(Code)



COMMIT
final public static Integer COMMIT(Code)



LOCK_ESCALATE
final public static Integer LOCK_ESCALATE(Code)



SAVEPOINT_ROLLBACK
final public static Integer SAVEPOINT_ROLLBACK(Code)



observerException
protected StandardException observerException(Code)





Method Detail
addUpdateTransaction
abstract public void addUpdateTransaction(int transactionStatus)(Code)
Add this raw transaction on to the list of update transaction



blockBackup
abstract public boolean blockBackup(boolean wait) throws StandardException(Code)



checkLogicalOperationOk
public void checkLogicalOperationOk() throws StandardException(Code)
Check to see if a logical operation is allowed by this transaction, throws a TransactionExceotion if it isn't. This implementation allows logical operations. Transactions that need to disallow logical operations should hide this method.
exception:
  StandardException - Standard Cloudscape error policy,



checkpointInRollForwardRecovery
abstract public void checkpointInRollForwardRecovery(LogInstant cinstant, long redoLWM) throws StandardException(Code)
redo a checkpoint during rollforward recovery



getCacheStats
abstract public long[] getCacheStats(String cacheName)(Code)
Get cache statistics for the specified cache



getDataFactory
abstract public DataFactory getDataFactory()(Code)
Get the data factory to be used during this transaction.



getFirstLogInstant
abstract public LogInstant getFirstLogInstant()(Code)
Get the log instant for the first log record written by this transaction.



getGlobalId
abstract public GlobalTransactionId getGlobalId()(Code)
Get the shortId of this transaction. May return null if transactio has no ID.



getId
abstract public TransactionId getId()(Code)
Get the shortId of this transaction. May return null if transactio has no ID.



getLastLogInstant
abstract public LogInstant getLastLogInstant()(Code)
Get the log instant for the last log record written by this transaction. If the transaction is unclear what its last log instant is, than it may return null.



getLockFactory
abstract public LockFactory getLockFactory()(Code)
Get the lock factory to be used during this transaction.



getLogBuffer
abstract public DynamicByteArrayOutputStream getLogBuffer()(Code)
Get the log buffer to be used during this transaction.



handlesPostTerminationWork
abstract public boolean handlesPostTerminationWork()(Code)
Can this transaction handles post termination work



inAbort
abstract public boolean inAbort()(Code)
Is the transaction in the middle of an abort.



inRollForwardRecovery
abstract public boolean inRollForwardRecovery()(Code)
Retunrs true if the transaction is part of rollforward recovery



isBlockingBackup
abstract public boolean isBlockingBackup()(Code)
Check if the transaction is blocking the backup ? true if this transaction is blocking the backup, otherwise false



logAndUndo
abstract public void logAndUndo(Compensation compensation, LogInstant undoInstant, LimitObjectInput in) throws StandardException(Code)
Log a compensation operation and then action it in the context of this transaction. The CompensationOperation is logged in the transaction log file and then its doMe method is called to perform the required change. This compensation operation will rollback the change that was done by the Loggable Operation at undoInstant.
Parameters:
  compensation - the Compensation Operation
Parameters:
  undoInstant - the LogInstant of the Loggable Operation this compensation operation is going to roll back
Parameters:
  in - optional data for the rollback operation
See Also:   Compensation
exception:
  StandardException - Standard cloudscape exception policy



notifyObservers
public void notifyObservers(Object arg)(Code)
Allow my users to notigy my observers.



openDroppedContainer
abstract public RawContainerHandle openDroppedContainer(ContainerKey containerId, LockingPolicy locking) throws StandardException(Code)
Open a container that may be dropped - use only by logging and recovery. During recovery redo, a log record may refer to a container that has long been dropped. This interface is provided so a dropped container may be opened. If the container has been dropped and is known to be committed, then even if we open the dropped container with forUpdate true, the container will be silently opened as read only. Logging and recovery code always check for committed drop status. Anybody else wanting to use this interface must keep this in mind.
exception:
  StandardException - Standard cloudscape exception policy



prepareTransaction
abstract public void prepareTransaction()(Code)
Change the state of transaction in table to prepare.



reCreateContainerForRedoRecovery
abstract public void reCreateContainerForRedoRecovery(long segmentId, long containerId, ByteArray containerInfo) throws StandardException(Code)
Recreate a container during redo recovery. Used during redo recovery when processing log records trying to create a container, but no container is found in the db.
exception:
  StandardException - Standard cloudscape exception policy



recoveryRollbackFirst
public boolean recoveryRollbackFirst()(Code)
Return true if this transaction should be rolled back first in recovery. This implementation returns false. Transactions that need to rollback first during recovery should hide this method.



recoveryTransaction
abstract public void recoveryTransaction()(Code)
Make this transaction aware that it is being used by recovery



removeUpdateTransaction
abstract public void removeUpdateTransaction()(Code)
Remove this raw transaction from the list of update transaction



reprepare
abstract public void reprepare() throws StandardException(Code)
During recovery re-prepare a transaction.

After redo() and undo(), this routine is called on all outstanding in-doubt (prepared) transactions. This routine re-acquires all logical write locks for operations in the xact, and then modifies the transaction table entry to make the transaction look as if it had just been prepared following startup after recovery.


exception:
  StandardException - Standard exception policy.




resetCacheStats
abstract public void resetCacheStats(String cacheName)(Code)
Reset the cache statistics for the specified cache



setFirstLogInstant
abstract public void setFirstLogInstant(LogInstant instant)(Code)
Set the log instant for the first log record written by this transaction.



setLastLogInstant
abstract public void setLastLogInstant(LogInstant instant)(Code)
Set the log instant for the last log record written by this transaction.



setObserverException
public void setObserverException(StandardException se)(Code)
Allow an Observer to indicate an exception to the transaction that is raised in its update() method.



setTransactionId
abstract public void setTransactionId(GlobalTransactionId id, TransactionId shortId)(Code)
Set the transaction Ids (Global and internal) of this transaction



setTransactionId
abstract public void setTransactionId(Loggable beginXact, TransactionId shortId)(Code)
Set the transactionId (Global and internal) of this transaction using a log record that contains the Global id



startNestedTopTransaction
abstract public RawTransaction startNestedTopTransaction() throws StandardException(Code)
Start a nested top transaction. A nested top transaction behaves exactly like a user transaction. Nested top transaction allow system type work to proceed in a separate transaction to the current user transaction and be committed independently of the user transaction (usually before the user transaction). Only one nested top transaction can be active in a context at any one time. After a commit the transaction may be re-used. A nested top transaction conflicts on the logical locks of its "parent" transaction.
exception:
  StandardException - Standard Cloudscape error policy



statusForBeginXactLog
abstract protected int statusForBeginXactLog()(Code)
Status that needs to go into the begin transaction log record, if there is one, to help with recovery



statusForEndXactLog
abstract protected int statusForEndXactLog()(Code)
Status that needs to go into the end transaction log record, if there is one, to help with recovery



Methods inherited from java.util.Observable
public synchronized void addObserver(Observer o)(Code)(Java Doc)
protected synchronized void clearChanged()(Code)(Java Doc)
public synchronized int countObservers()(Code)(Java Doc)
public synchronized void deleteObserver(Observer o)(Code)(Java Doc)
public synchronized void deleteObservers()(Code)(Java Doc)
public synchronized boolean hasChanged()(Code)(Java Doc)
public void notifyObservers()(Code)(Java Doc)
public void notifyObservers(Object arg)(Code)(Java Doc)
protected synchronized void setChanged()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

ww_w.__ja___v___a2s__.c__o___m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.