bitronix.tm.resource.jdbc.lrc
Class LrcXAResource
java.lang.Object
   bitronix.tm.resource.jdbc.lrc.LrcXAResource
bitronix.tm.resource.jdbc.lrc.LrcXAResource
- All Implemented Interfaces: 
- XAResource
- public class LrcXAResource 
- extends Object- implements XAResource
XAResource implementation for a non-XA JDBC connection emulating XA with Last Resource Commit.
 
The XA protocol flow is implemented by this state machine:
 
 NO_TX
   |
   | start(TMNOFLAGS)
   |
   |       end(TMFAIL)
 STARTED -------------- NO_TX
   |
   | end(TMSUCCESS)
   |
   |    start(TMJOIN)
 ENDED ---------------- STARTED
   |\
   | \  commit (one phase)
   |  ----------------- NO_TX
   |
   | prepare()
   |
   |       commit() or
   |       rollback()
 PREPARED ------------- NO_TX
 
 XAResource.TMSUSPEND and XAResource.TMRESUME are not supported.
- Author:
- lorban
 
| Fields inherited from interface javax.transaction.xa.XAResource | 
| TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY | 
 
 
 
 
NO_TX
public static final int NO_TX
- See Also:
- Constant Field Values
STARTED
public static final int STARTED
- See Also:
- Constant Field Values
ENDED
public static final int ENDED
- See Also:
- Constant Field Values
PREPARED
public static final int PREPARED
- See Also:
- Constant Field Values
LrcXAResource
public LrcXAResource(Connection connection)
getState
public int getState()
- 
 
- 
 
getTransactionTimeout
public int getTransactionTimeout()
                          throws XAException
- 
- Specified by:
- getTransactionTimeoutin interface- XAResource
 
- 
- Throws:
- XAException
 
setTransactionTimeout
public boolean setTransactionTimeout(int seconds)
                              throws XAException
- 
- Specified by:
- setTransactionTimeoutin interface- XAResource
 
- 
- Throws:
- XAException
 
forget
public void forget(Xid xid)
            throws XAException
- 
- Specified by:
- forgetin interface- XAResource
 
- 
- Throws:
- XAException
 
recover
public Xid[] recover(int flags)
              throws XAException
- 
- Specified by:
- recoverin interface- XAResource
 
- 
- Throws:
- XAException
 
isSameRM
public boolean isSameRM(XAResource xaResource)
                 throws XAException
- 
- Specified by:
- isSameRMin interface- XAResource
 
- 
- Throws:
- XAException
 
start
public void start(Xid xid,
                  int flag)
           throws XAException
- 
- Specified by:
- startin interface- XAResource
 
- 
- Throws:
- XAException
 
end
public void end(Xid xid,
                int flag)
         throws XAException
- 
- Specified by:
- endin interface- XAResource
 
- 
- Throws:
- XAException
 
prepare
public int prepare(Xid xid)
            throws XAException
- 
- Specified by:
- preparein interface- XAResource
 
- 
- Throws:
- XAException
 
commit
public void commit(Xid xid,
                   boolean onePhase)
            throws XAException
- 
- Specified by:
- commitin interface- XAResource
 
- 
- Throws:
- XAException
 
rollback
public void rollback(Xid xid)
              throws XAException
- 
- Specified by:
- rollbackin interface- XAResource
 
- 
- Throws:
- XAException
 
toString
public String toString()
- 
- Overrides:
- toStringin class- Object
 
- 
 
Copyright © 2006-2013 Bitronix Software. All Rights Reserved.