Java Doc for XactXAResourceManager.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.XactXAResourceManager

XactXAResourceManager
public class XactXAResourceManager implements XAResourceManager(Code)
The XactXAResourceManager implements the Access XAResource interface, which provides offline control over two phase commit transactions. It is expected to be used by TM's (transaction manager's), to recover if systems fail while transactions are still in-doubt (prepared).

This interface allows access to commit,prepare,abort global transactions as part of a two phase commit protocol. These interfaces have been chosen to be exact implementations required to implement the XAResource interfaces as part of the JTA standard extension.

It is expected that the following interfaces are only used during the recovery portion of 2 phase commit, when the transaction manager is cleaning up after a runtime crash - it is expected that no current context managers exist for the Xid's being operated on. The "online" two phase commit protocol will be implemented by calls directly on a TransactionController.

The XAResource interface is a Java mapping of the industry standard XA resource manager interface. Please refer to: X/Open CAE Specification - Distributed Transaction Processing: The XA Specification, X/Open Document No. XO/CAE/91/300 or ISBN 1 872630 24 3.
See Also:   org.apache.derby.iapi.store.access.xa.XAResourceManager




Constructor Summary
public  XactXAResourceManager(RawStoreFactory rsf, TransactionTable tt)
    

Method Summary
public  voidcommit(ContextManager cm, Xid xid, boolean onePhase)
     This method is called to commit the global transaction specified by xid.
public  ContextManagerfind(Xid xid)
     Find the given Xid in the transaction table.

This routine is used to find a in-doubt transaction from the list of Xid's returned from the recover() routine.

public  voidforget(ContextManager cm, Xid xid)
     This method is called to remove the given transaction from the transaction table/log.

Used to let the store remove all record from log and transaction table of the given transaction.

public  Xid[]recover(int flags)
     This method is called to obtain a list of prepared transactions.

This call returns a complete list of global transactions which are either prepared or heuristically complete.

The XAResource interface expects a scan type interface, but our implementation only returns a complete list of transactions.

public  voidrollback(ContextManager cm, Xid xid)
     rollback the transaction identified by Xid.


Constructor Detail
XactXAResourceManager
public XactXAResourceManager(RawStoreFactory rsf, TransactionTable tt)(Code)
Constructors for This class:




Method Detail
commit
public void commit(ContextManager cm, Xid xid, boolean onePhase) throws StandardException(Code)
This method is called to commit the global transaction specified by xid.

RESOLVE - how do we map to the "right" XAExceptions.


Parameters:
  cm - The ContextManager returned from the find() call.
Parameters:
  xid - A global transaction identifier.
Parameters:
  onePhase - If true, the resource manager should use a one-phasecommit protocol to commit the work done on behalf of xid.
exception:
  StandardException - Standard exception policy.




find
public ContextManager find(Xid xid)(Code)
Find the given Xid in the transaction table.

This routine is used to find a in-doubt transaction from the list of Xid's returned from the recover() routine.

In the current implementation it is up to the calling routine to make the returned ContextManager the "current" ContextManager before calls to commit,abort, or forget. The caller is responsible for error handling, ie. calling cleanupOnError() on the correct ContextManager.

If the Xid is not in the system, "null" is returned. RESOLVE - find out from sku if she wants a exception instead?


Parameters:
  xid - A global transaction identifier.




forget
public void forget(ContextManager cm, Xid xid) throws StandardException(Code)
This method is called to remove the given transaction from the transaction table/log.

Used to let the store remove all record from log and transaction table of the given transaction. This should only be used to clean up heuristically completed transactions, otherwise commit or abort should be used to act on other transactions.


Parameters:
  cm - The ContextManager returned from the find() call.
Parameters:
  xid - A global transaction identifier.
exception:
  StandardException - Standard exception policy.




recover
public Xid[] recover(int flags) throws StandardException(Code)
This method is called to obtain a list of prepared transactions.

This call returns a complete list of global transactions which are either prepared or heuristically complete.

The XAResource interface expects a scan type interface, but our implementation only returns a complete list of transactions. So to simulate the scan the following state is maintained. If TMSTARTSCAN is specified the complete list is returned. If recover is called with TMNOFLAGS is ever called a 0 length array is returned. Return a array with 0 or more Xid's which are currently inprepared or heuristically completed state. If an error occursduring the operation, an appropriate error is thrown.
Parameters:
  flags - combination of the following flags XAResource.{TMSTARTRSCAN,TMENDRSCAN,TMNOFLAGS}. TMNOFLAGS must be used when no other flags are used.
exception:
  StandardException - Standard exception policy.




rollback
public void rollback(ContextManager cm, Xid xid) throws StandardException(Code)
rollback the transaction identified by Xid.

The given transaction is roll'ed back and it's history is not maintained in the transaction table or long term log.


Parameters:
  cm - The ContextManager returned from the find() call.
Parameters:
  xid - A global transaction identifier.
exception:
  StandardException - Standard exception policy.




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__av___a2__s.__com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.