Java Doc for MysqlXAConnection.java in  » Database-JDBC-Connection-Pool » mysql-connector-java-5.1.3 » com » mysql » jdbc » jdbc2 » optional » 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 JDBC Connection Pool » mysql connector java 5.1.3 » com.mysql.jdbc.jdbc2.optional 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.mysql.jdbc.jdbc2.optional.MysqlPooledConnection
      com.mysql.jdbc.jdbc2.optional.MysqlXAConnection

MysqlXAConnection
public class MysqlXAConnection extends MysqlPooledConnection implements XAConnection,XAResource(Code)
An object that provides support for distributed transactions. An XAConnection object may be enlisted in a distributed transaction by means of an XAResource object. A transaction manager, usually part of a middle tier server, manages an XAConnection object through the XAResource object.

An application programmer does not use this interface directly; rather, it is used by a transaction manager working in the middle tier server.
since:
   1.4



Field Summary
protected  booleanlogXaCommands
    

Constructor Summary
public  MysqlXAConnection(ConnectionImpl connection, boolean logXaCommands)
    

Method Summary
public  voidcommit(Xid xid, boolean onePhase)
     Commits the global transaction specified by xid.
throws:
  XAException - An error has occurred.
public  voidend(Xid xid, int flags)
     Ends the work performed on behalf of a transaction branch. The resource manager disassociates the XA resource from the transaction branch specified and lets the transaction complete. If TMSUSPEND is specified in the flags, the transaction branch is temporarily suspended in an incomplete state.
public  voidforget(Xid xid)
     Tells the resource manager to forget about a heuristically completed transaction branch.
throws:
  XAException - An error has occurred.
public synchronized  ConnectiongetConnection()
    
public  intgetTransactionTimeout()
     Obtains the current transaction timeout value set for this XAResource instance.
public  XAResourcegetXAResource()
     Retrieves an XAResource object that the transaction manager will use to manage this XAConnection object's participation in a distributed transaction.
public  booleanisSameRM(XAResource xares)
     This method is called to determine if the resource manager instance represented by the target object is the same as the resouce manager instance represented by the parameter xares. true if it's the same RM instance; otherwise false.
throws:
  XAException - An error has occurred.
protected static  XAExceptionmapXAExceptionFromSQLException(SQLException sqlEx)
    
public  intprepare(Xid xid)
     Asks the resource manager to prepare for a transaction commit of the transaction specified in xid.
throws:
  XAException - An error has occurred.
public  Xid[]recover(int flag)
     This method is called to obtain a list of prepared transaction branches from a resource manager.
protected static  Xid[]recover(Connection c, int flag)
    
public  voidrollback(Xid xid)
     Informs the resource manager to roll back work done on behalf of a transaction branch.
throws:
  XAException - An error has occurred.
public  booleansetTransactionTimeout(int arg0)
     Sets the current transaction timeout value for this XAResource instance. Once set, this timeout value is effective until setTransactionTimeout is invoked again with a different value. To reset the timeout value to the default value used by the resource manager, set the value to zero.
public  voidstart(Xid xid, int flags)
     Starts work on behalf of a transaction branch specified in xid. If TMJOIN is specified, the start applies to joining a transaction previously seen by the resource manager. If TMRESUME is specified, the start applies to resuming a suspended transaction specified in the parameter xid. If neither TMJOIN nor TMRESUME is specified and the transaction specified by xid has previously been seen by the resource manager, the resource manager throws the XAException exception with XAER_DUPID error code.
throws:
  XAException - An error has occurred.

Field Detail
logXaCommands
protected boolean logXaCommands(Code)




Constructor Detail
MysqlXAConnection
public MysqlXAConnection(ConnectionImpl connection, boolean logXaCommands) throws SQLException(Code)

Parameters:
  connection -




Method Detail
commit
public void commit(Xid xid, boolean onePhase) throws XAException(Code)
Commits the global transaction specified by xid.
throws:
  XAException - An error has occurred. Possible XAExceptions are XA_HEURHAZ,XA_HEURCOM, XA_HEURRB, XA_HEURMIX, XAER_RMERR, XAER_RMFAIL,XAER_NOTA, XAER_INVAL, or XAER_PROTO.If the resource manager did not commit the transaction and the parameteronePhase is set to true, the resource manager may throw one of the XA_RB*exceptions.Upon return, the resource manager has rolled back the branch's work andhas released all held resources.



end
public void end(Xid xid, int flags) throws XAException(Code)
Ends the work performed on behalf of a transaction branch. The resource manager disassociates the XA resource from the transaction branch specified and lets the transaction complete. If TMSUSPEND is specified in the flags, the transaction branch is temporarily suspended in an incomplete state. The transaction context is in a suspended state and must be resumed via the start method with TMRESUME specified. If TMFAIL is specified, the portion of work has failed. The resource manager may mark the transaction as rollback-only If TMSUCCESS is specified, the portion of work has completed successfully.
throws:
  XAException - -An error has occurred. Possible XAException values areXAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, XAER_PROTO,or XA_RB*.



forget
public void forget(Xid xid) throws XAException(Code)
Tells the resource manager to forget about a heuristically completed transaction branch.
throws:
  XAException - An error has occurred. Possible exception values areXAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, orXAER_PROTO.



getConnection
public synchronized Connection getConnection() throws SQLException(Code)



getTransactionTimeout
public int getTransactionTimeout() throws XAException(Code)
Obtains the current transaction timeout value set for this XAResource instance. If XAResource.setTransactionTimeout was not used prior to invoking this method, the return value is the default timeout set for the resource manager; otherwise, the value used in the previous setTransactionTimeout call is returned. the transaction timeout value in seconds.
throws:
  XAException - An error has occurred. Possible exception values areXAER_RMERR and XAER_RMFAIL.



getXAResource
public XAResource getXAResource() throws SQLException(Code)
Retrieves an XAResource object that the transaction manager will use to manage this XAConnection object's participation in a distributed transaction. the XAResource object
exception:
  SQLException - if a database access error occurs



isSameRM
public boolean isSameRM(XAResource xares) throws XAException(Code)
This method is called to determine if the resource manager instance represented by the target object is the same as the resouce manager instance represented by the parameter xares. true if it's the same RM instance; otherwise false.
throws:
  XAException - An error has occurred. Possible exception values areXAER_RMERR and XAER_RMFAIL.



mapXAExceptionFromSQLException
protected static XAException mapXAExceptionFromSQLException(SQLException sqlEx)(Code)



prepare
public int prepare(Xid xid) throws XAException(Code)
Asks the resource manager to prepare for a transaction commit of the transaction specified in xid.
throws:
  XAException - An error has occurred. Possible exception values are: XA_RB*,XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, orXAER_PROTO.



recover
public Xid[] recover(int flag) throws XAException(Code)
This method is called to obtain a list of prepared transaction branches from a resource manager. The transaction manager calls this method during recovery to obtain the list of transaction branches that are currently in prepared or heuristically completed states. The flag parameter indicates where the recover scan should start or end, or start and end. This method may be invoked one or more times during a recovery scan. The resource manager maintains a cursor which marks the current position of the prepared or heuristically completed transaction list. Each invocation of the recover method moves the cursor passed the set of Xids that are returned. Two consecutive invocation of this method that starts from the beginning of the list must return the same list of transaction branches unless one of the following takes place: - the transaction manager invokes the commit, forget, prepare, or rollback method for that resource manager, between the two consecutive invocation of the recovery scan. - the resource manager heuristically completes some transaction branches between the two invocation of the recovery scan.
Parameters:
  flag - One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS must beused when no other flags are set in the parameter.
throws:
  XAException - An error has occurred. Possible values are XAER_RMERR,XAER_RMFAIL, XAER_INVAL, and XAER_PROTO.



recover
protected static Xid[] recover(Connection c, int flag) throws XAException(Code)



rollback
public void rollback(Xid xid) throws XAException(Code)
Informs the resource manager to roll back work done on behalf of a transaction branch.
throws:
  XAException - An error has occurred. Possible XAExceptions are XA_HEURHAZ,XA_HEURCOM, XA_HEURRB, XA_HEURMIX, XAER_RMERR, XAER_RMFAIL,XAER_NOTA, XAER_INVAL, or XAER_PROTO.If the transaction branch is already marked rollback-only the resourcemanager may throw one of the XA_RB* exceptions.Upon return, the resource manager has rolled back the branch's work andhas released all held resources.



setTransactionTimeout
public boolean setTransactionTimeout(int arg0) throws XAException(Code)
Sets the current transaction timeout value for this XAResource instance. Once set, this timeout value is effective until setTransactionTimeout is invoked again with a different value. To reset the timeout value to the default value used by the resource manager, set the value to zero. If the timeout operation is performed successfully, the method returns true; otherwise false. If a resource manager does not support explicitly setting the transaction timeout value, this method returns false. true if the transaction timeout value is set successfully;otherwise false.
throws:
  XAException - An error has occurred. Possible exception values areXAER_RMERR, XAER_RMFAIL, or XAER_INVAL.



start
public void start(Xid xid, int flags) throws XAException(Code)
Starts work on behalf of a transaction branch specified in xid. If TMJOIN is specified, the start applies to joining a transaction previously seen by the resource manager. If TMRESUME is specified, the start applies to resuming a suspended transaction specified in the parameter xid. If neither TMJOIN nor TMRESUME is specified and the transaction specified by xid has previously been seen by the resource manager, the resource manager throws the XAException exception with XAER_DUPID error code.
throws:
  XAException - An error has occurred. Possible exceptions are XA_RB*,XAER_RMERR, XAER_RMFAIL, XAER_DUPID, XAER_OUTSIDE, XAER_NOTA,XAER_INVAL, or XAER_PROTO.



Fields inherited from com.mysql.jdbc.jdbc2.optional.MysqlPooledConnection
final public static int CONNECTION_CLOSED_EVENT(Code)(Java Doc)
final public static int CONNECTION_ERROR_EVENT(Code)(Java Doc)

Methods inherited from com.mysql.jdbc.jdbc2.optional.MysqlPooledConnection
public synchronized void addConnectionEventListener(ConnectionEventListener connectioneventlistener)(Code)(Java Doc)
protected synchronized void callListener(int eventType, SQLException sqlException)(Code)(Java Doc)
public synchronized void close() throws SQLException(Code)(Java Doc)
public synchronized Connection getConnection() throws SQLException(Code)(Java Doc)
protected synchronized Connection getConnection(boolean resetServerState, boolean forXa) throws SQLException(Code)(Java Doc)
public synchronized void removeConnectionEventListener(ConnectionEventListener connectioneventlistener)(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)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.