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


java.lang.Object
   org.apache.derby.impl.store.raw.xact.XactFactory

XactFactory
public class XactFactory implements TransactionFactory,ModuleControl,ModuleSupportable(Code)


Field Summary
final protected static  StringINTERNAL_CONTEXT_ID
    
final protected static  StringNESTED_READONLY_USER_CONTEXT_ID
    
final protected static  StringNESTED_UPDATE_USER_CONTEXT_ID
    
final protected static  StringNTT_CONTEXT_ID
    
final protected static  StringUSER_CONTEXT_ID
    
protected  ContextServicecontextFactory
    
protected  DataFactorydataFactory
    
protected  LockFactorylockFactory
    
protected  LogFactorylogFactory
    
protected  DaemonServicerawStoreDaemon
    
protected  RawStoreFactoryrawStoreFactory
    
public  TransactionTablettab
    

Constructor Summary
public  XactFactory()
    

Method Summary
protected  voidadd(Xact xact, boolean excludeMe)
    
protected  voidaddUpdateTransaction(TransactionId id, RawTransaction t, int transactionStatus)
     Add a transaction to the list of transactions that has updated the raw store.
protected  booleanblockBackup(boolean wait)
     Block the online backup.
public  booleanblockBackupBlockingOperations(boolean wait)
     Checks if there are any backup blocking operations in progress and prevents new ones from starting until the backup is finished.
public  voidboot(boolean create, Properties properties)
    
public  booleancanSupport(Properties startParams)
    
public  voidcreateFinished()
    
public  booleanfindTransaction(TransactionId id, RawTransaction tran)
     Find the TransactionTableEntry with the given ID and make the passed in transaction assume the identity and properties of that TransactionTableEntry.
public  RawTransactionfindUserTransaction(RawStoreFactory rsf, ContextManager contextMgr, String transName)
    
public  LogInstantfirstUpdateInstant()
     Get the earliest log instant that is still active, ie, the first log record logged by the earliest transaction that is still active.
public  booleanflushLogOnCommit(String contextName)
    
public  LockFactorygetLockFactory()
     Get the LockFactory to use with this store.
final  LockingPolicygetLockingPolicy(int mode, int isolation, boolean stricterOk)
     Get a locking policy for a transaction.
public  TransactionInfo[]getTransactionInfo()
    
public  FormatablegetTransactionTable()
    
public  ObjectgetXAResourceManager()
    
public  voidhandlePreparedXacts(RawStoreFactory rsf)
     Run through all prepared transactions known to this factory and restore their state such that they remain after recovery, and can be found and handled by a XA transaction manager.
public  booleanhasPreparedXact()
     Check if there are any prepared transanctions in the transaction table.
public  booleaninDatabaseCreation()
    
public  UUIDmakeNewUUID()
    
public  StandardExceptionmarkCorrupt(StandardException originalError)
     Really this is just a convience routine for callers that might not have access to a log factory.
public  booleannoActiveUpdateTransaction()
     Returns true if there is no in flight updating tranasaction.
protected  voidprepareTransaction(TransactionId id)
     Change state of transaction to prepared.
protected  voidpushTransactionContext(ContextManager cm, String contextName, Xact xact, boolean abortAll, RawStoreFactory rsf, boolean excludeMe)
     Create a new RawTransaction, a context for it and push the context onto the current context manager.
protected  booleanremove(TransactionId xactId)
    
protected  voidremoveUpdateTransaction(TransactionId id)
     Remove a transaction from the list of transactions that has updated the raw store.
public  voidresetTranId()
    
public  voidrollbackAllTransactions(RawTransaction recoveryTransaction, RawStoreFactory rsf)
     Rollback all active transactions that has updated the raw store.
public  voidsetNewTransactionId(TransactionId oldxid, Xact t)
    
public  voidsetRawStoreFactory(RawStoreFactory rsf)
    
public  RawTransactionstartGlobalTransaction(RawStoreFactory rsf, ContextManager cm, int format_id, byte[] global_id, byte[] branch_id)
    
public  RawTransactionstartInternalTransaction(RawStoreFactory rsf, ContextManager cm)
    
public  RawTransactionstartNestedReadOnlyUserTransaction(RawStoreFactory rsf, Object compatibilitySpace, ContextManager cm, String transName)
    
public  RawTransactionstartNestedTopTransaction(RawStoreFactory rsf, ContextManager cm)
    
public  RawTransactionstartNestedUpdateUserTransaction(RawStoreFactory rsf, ContextManager cm, String transName)
    
public  RawTransactionstartTransaction(RawStoreFactory rsf, ContextManager cm, String transName)
    
public  voidstop()
    
public  booleansubmitPostCommitWork(Serviceable work)
    
protected  voidunblockBackup()
     Unblock the backup, a backup blocking operation finished.
public  voidunblockBackupBlockingOperations()
     Backup completed.
public  voiduseTransactionTable(Formatable transactionTable)
    

Field Detail
INTERNAL_CONTEXT_ID
final protected static String INTERNAL_CONTEXT_ID(Code)



NESTED_READONLY_USER_CONTEXT_ID
final protected static String NESTED_READONLY_USER_CONTEXT_ID(Code)



NESTED_UPDATE_USER_CONTEXT_ID
final protected static String NESTED_UPDATE_USER_CONTEXT_ID(Code)



NTT_CONTEXT_ID
final protected static String NTT_CONTEXT_ID(Code)



USER_CONTEXT_ID
final protected static String USER_CONTEXT_ID(Code)



contextFactory
protected ContextService contextFactory(Code)



dataFactory
protected DataFactory dataFactory(Code)



lockFactory
protected LockFactory lockFactory(Code)



logFactory
protected LogFactory logFactory(Code)



rawStoreDaemon
protected DaemonService rawStoreDaemon(Code)



rawStoreFactory
protected RawStoreFactory rawStoreFactory(Code)



ttab
public TransactionTable ttab(Code)




Constructor Detail
XactFactory
public XactFactory()(Code)




Method Detail
add
protected void add(Xact xact, boolean excludeMe)(Code)



addUpdateTransaction
protected void addUpdateTransaction(TransactionId id, RawTransaction t, int transactionStatus)(Code)
Add a transaction to the list of transactions that has updated the raw store.

This is called underneath the BeginXact log operation's doMe method. The logging system must guarentee that transactions are added in the true order they are started, as defined by the order of beginXact log record in the log.




blockBackup
protected boolean blockBackup(boolean wait) throws StandardException(Code)
Block the online backup. Backup needs to be blocked while executing any unlogged operations or any opearation that prevents from making a consistent backup.
Parameters:
  wait - if true, waits until the backup is blocked. true if backup is blocked.false otherwise.
exception:
  StandardException - if interrupted while waiting for a backup to complete.



blockBackupBlockingOperations
public boolean blockBackupBlockingOperations(boolean wait) throws StandardException(Code)
Checks if there are any backup blocking operations in progress and prevents new ones from starting until the backup is finished. If backup blocking operations are in progress and wait parameter value is true, then it will wait for the current backup blocking operations to finish. A Consistent backup can not be made if there are any backup blocking operations (like unlogged operations) are in progress
Parameters:
  wait - if true, waits for the current backup blocking operation in progress to finish. true if no backup blocking operations are in progressfalse otherwise.
exception:
  StandardException - if interrupted or a runtime exception occurs



boot
public void boot(boolean create, Properties properties) throws StandardException(Code)



canSupport
public boolean canSupport(Properties startParams)(Code)



createFinished
public void createFinished() throws StandardException(Code)
Database creation finished
exception:
  StandardException - standard cloudscape error policy



findTransaction
public boolean findTransaction(TransactionId id, RawTransaction tran)(Code)
Find the TransactionTableEntry with the given ID and make the passed in transaction assume the identity and properties of that TransactionTableEntry. Used in recovery only.



findUserTransaction
public RawTransaction findUserTransaction(RawStoreFactory rsf, ContextManager contextMgr, String transName) throws StandardException(Code)



firstUpdateInstant
public LogInstant firstUpdateInstant()(Code)
Get the earliest log instant that is still active, ie, the first log record logged by the earliest transaction that is still active.
The logging system must guarentee that the transaction table is populated in the order transactions are started. Used in recovery only.



flushLogOnCommit
public boolean flushLogOnCommit(String contextName)(Code)
Decide if a transaction of this contextId needs to flush the log when it commits



getLockFactory
public LockFactory getLockFactory()(Code)
Get the LockFactory to use with this store.



getLockingPolicy
final LockingPolicy getLockingPolicy(int mode, int isolation, boolean stricterOk)(Code)
Get a locking policy for a transaction.



getTransactionInfo
public TransactionInfo[] getTransactionInfo()(Code)



getTransactionTable
public Formatable getTransactionTable()(Code)



getXAResourceManager
public Object getXAResourceManager() throws StandardException(Code)



handlePreparedXacts
public void handlePreparedXacts(RawStoreFactory rsf) throws StandardException(Code)
Run through all prepared transactions known to this factory and restore their state such that they remain after recovery, and can be found and handled by a XA transaction manager. This includes creating a context manager for each, pushing a xact context, and reclaiming update locks on all data changed by the transaction. Expected to be called just after the redo and undo recovery loops, where the transaction table should be empty except for prepared xacts. Used only in recovery.
exception:
  StandardException - Cloudscape Standard Error policy



hasPreparedXact
public boolean hasPreparedXact()(Code)
Check if there are any prepared transanctions in the transaction table. Caller must be aware that if there is no other mechanism to stop transactions from starting and ending, then this information is outdated as soon as it is reported. true if there are prepared transactions in the transaction table,false otherwise.



inDatabaseCreation
public boolean inDatabaseCreation()(Code)



makeNewUUID
public UUID makeNewUUID()(Code)
Make a new UUID for whomever that wants it



markCorrupt
public StandardException markCorrupt(StandardException originalError)(Code)
Really this is just a convience routine for callers that might not have access to a log factory.



noActiveUpdateTransaction
public boolean noActiveUpdateTransaction()(Code)
Returns true if there is no in flight updating tranasaction. Caller must be aware that if there is no other mechanism to stop transactions from starting and ending, then this information is outdated as soon as it is reported. Only call this function in special times - e.g, during recovery



prepareTransaction
protected void prepareTransaction(TransactionId id)(Code)
Change state of transaction to prepared. Used by recovery to update the transaction table entry to prepared state.



pushTransactionContext
protected void pushTransactionContext(ContextManager cm, String contextName, Xact xact, boolean abortAll, RawStoreFactory rsf, boolean excludeMe) throws StandardException(Code)
Create a new RawTransaction, a context for it and push the context onto the current context manager. Then add the transacion to the transaction table.
Parameters:
  contextName - the name of the transaction context
Parameters:
  xact - the Transaction object
Parameters:
  abortAll - if true, then any error will abort the wholetransaction. Otherwise, let XactContext.cleanupOnError decide what todo
Parameters:
  rsf - the raw store factory
Parameters:
  excludeMe - during systeme quiesce, i.e., this transaction shouldnot be allowed to be active during a quiesce state.
exception:
  StandardException - Standard Cloudscape error policy



remove
protected boolean remove(TransactionId xactId)(Code)



removeUpdateTransaction
protected void removeUpdateTransaction(TransactionId id)(Code)
Remove a transaction from the list of transactions that has updated the raw store.



resetTranId
public void resetTranId()(Code)



rollbackAllTransactions
public void rollbackAllTransactions(RawTransaction recoveryTransaction, RawStoreFactory rsf) throws StandardException(Code)
Rollback all active transactions that has updated the raw store. Use the recovery Transaction that is passed in to do all the work. Used in recovery only.

Transactions are rolled back in the following order:

  1. internal transactions in reversed beginXact chronological order,
  2. all other transactions in reversed beginXact chronological order,
    Parameters:
      recoveryTransaction - use this transaction to do all the user transaction work
    exception:
      StandardException - any exception thrown during rollback



setNewTransactionId
public void setNewTransactionId(TransactionId oldxid, Xact t)(Code)



setRawStoreFactory
public void setRawStoreFactory(RawStoreFactory rsf) throws StandardException(Code)



startGlobalTransaction
public RawTransaction startGlobalTransaction(RawStoreFactory rsf, ContextManager cm, int format_id, byte[] global_id, byte[] branch_id) throws StandardException(Code)



startInternalTransaction
public RawTransaction startInternalTransaction(RawStoreFactory rsf, ContextManager cm) throws StandardException(Code)



startNestedReadOnlyUserTransaction
public RawTransaction startNestedReadOnlyUserTransaction(RawStoreFactory rsf, Object compatibilitySpace, ContextManager cm, String transName) throws StandardException(Code)



startNestedTopTransaction
public RawTransaction startNestedTopTransaction(RawStoreFactory rsf, ContextManager cm) throws StandardException(Code)



startNestedUpdateUserTransaction
public RawTransaction startNestedUpdateUserTransaction(RawStoreFactory rsf, ContextManager cm, String transName) throws StandardException(Code)



startTransaction
public RawTransaction startTransaction(RawStoreFactory rsf, ContextManager cm, String transName) throws StandardException(Code)



stop
public void stop()(Code)



submitPostCommitWork
public boolean submitPostCommitWork(Serviceable work)(Code)
Submit this post commit work to the post commit daemon



unblockBackup
protected void unblockBackup()(Code)
Unblock the backup, a backup blocking operation finished.



unblockBackupBlockingOperations
public void unblockBackupBlockingOperations()(Code)
Backup completed. Allow backup blocking operations.



useTransactionTable
public void useTransactionTable(Formatable transactionTable) throws StandardException(Code)



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)

w___w__w___._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.