|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.derby.jdbc.EmbedPooledConnection
org.apache.derby.jdbc.EmbedXAConnection
| Field Summary | |
protected BrokeredConnection |
currentConnectionHandle
|
(package private) XAXactId |
currentXid
|
protected ReferenceableDataSource |
dataSource
|
protected int |
defaultIsolationLevel
|
(package private) ResourceAdapter |
ra
|
protected EmbedConnection |
realConnection
|
| Fields inherited from interface javax.transaction.xa.XAResource |
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY |
| Constructor Summary | |
(package private) |
EmbedXAConnection(EmbeddedDataSource ds,
ResourceAdapter ra,
java.lang.String u,
java.lang.String p,
boolean requestPassword)
|
| Method Summary | |
void |
addConnectionEventListener(javax.sql.ConnectionEventListener listener)
Add an event listener. |
protected void |
checkActive()
|
void |
checkAutoCommit(boolean autoCommit)
Allow control over setting auto commit mode. |
void |
checkCommit()
Allow control over calling commit. |
void |
checkHoldCursors(int holdability)
Are held cursors allowed. |
void |
checkRollback()
Allow control over calling rollback. |
void |
checkSavepoint()
Allow control over creating a Savepoint (JDBC 3.0) |
private void |
checkUserCredentials(EmbedXAConnection original)
|
private void |
checkXAActive()
|
void |
close()
Close the Pooled connection. |
protected void |
closeCurrentConnectionHandle()
In this case the Listeners are *not* notified. |
private static void |
closeUnusedConnection(EmbedConnection conn)
Close an underlying connection object when there is no active XAResource to hand it to. |
boolean |
closingConnection()
Close called on BrokeredConnection. |
void |
commit(javax.transaction.xa.Xid xid,
boolean onePhase)
Commit the global transaction specified by xid. |
void |
end(javax.transaction.xa.Xid xid,
int flags)
Ends the work performed on behalf of a transaction branch. |
void |
forget(javax.transaction.xa.Xid xid)
Tell the resource manager to forget about a heuristically completed transaction branch. |
java.sql.Connection |
getConnection()
Create an object handle for a database connection. |
protected java.sql.Connection |
getNewCurrentConnectionHandle()
|
(package private) java.lang.String |
getPassword()
|
int |
getPrepareIsolation()
Get prepare isolation level. |
java.sql.Connection |
getRealConnection()
Override getRealConnection to create a a local connection when we are not associated with an XA transaction. |
private XATransactionState |
getTransactionState(XAXactId xid_im)
|
int |
getTransactionTimeout()
Obtain the current transaction timeout value set for this XAResource instance. |
(package private) java.lang.String |
getUsername()
|
javax.transaction.xa.XAResource |
getXAResource()
|
boolean |
isSameRM(javax.transaction.xa.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. |
void |
notifyClose()
|
void |
notifyError(java.sql.SQLException exception)
|
void |
notifyException(java.sql.SQLException sqle)
Notify the control class that a SQLException was thrown during a call on one of the brokered connection's methods. |
protected void |
openRealConnection()
|
int |
prepare(javax.transaction.xa.Xid xid)
Ask the resource manager to prepare for a transaction commit of the transaction specified in xid. |
javax.transaction.xa.Xid[] |
recover(int flag)
Obtain a list of prepared transaction branches from a resource manager. |
void |
removeConnectionEventListener(javax.sql.ConnectionEventListener listener)
Remove an event listener. |
(package private) void |
removeXATransaction(XAXactId xid_im)
|
protected void |
resetRealConnection()
|
private void |
returnConnectionToResource(XATransactionState tranState,
XAXactId xid_im)
Return an underlying connection object back to its XAResource if possible. |
void |
rollback(javax.transaction.xa.Xid xid)
Inform the resource manager to roll back work done on behalf of a transaction branch |
void |
setDrdaID(java.lang.String drdaID)
set DrdaId for this connection. |
void |
setPrepareIsolation(int level)
Set the internal isolation level to use for preparing statements. |
boolean |
setTransactionTimeout(int seconds)
Set the current transaction timeout value for this XAResource instance. |
void |
start(javax.transaction.xa.Xid xid,
int flags)
Start work on behalf of a transaction branch specified in xid If TMJOIN is specified, the start is for joining a transaction previously seen by the resource manager. |
java.lang.String |
toString()
Get the string representation of this pooled connection. |
private static javax.transaction.xa.XAException |
wrapInXAException(java.sql.SQLException se)
Map a SQL exception to appropriate XAException. |
private static javax.transaction.xa.XAException |
wrapInXAException(StandardException se)
Map a Standard exception to appropriate XAException. |
java.sql.CallableStatement |
wrapStatement(java.sql.CallableStatement cs,
java.lang.String sql)
Wrap and control a PreparedStatement |
java.sql.PreparedStatement |
wrapStatement(java.sql.PreparedStatement ps,
java.lang.String sql,
java.lang.Object generatedKeys)
Wrap and control a PreparedStatement |
java.sql.Statement |
wrapStatement(java.sql.Statement s)
Wrap and control a Statement |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.sql.PooledConnection |
addConnectionEventListener, close, removeConnectionEventListener |
| Field Detail |
final ResourceAdapter ra
XAXactId currentXid
protected EmbedConnection realConnection
protected int defaultIsolationLevel
protected BrokeredConnection currentConnectionHandle
protected final ReferenceableDataSource dataSource
| Constructor Detail |
EmbedXAConnection(EmbeddedDataSource ds,
ResourceAdapter ra,
java.lang.String u,
java.lang.String p,
boolean requestPassword)
throws java.sql.SQLException
| Method Detail |
public final javax.transaction.xa.XAResource getXAResource()
throws java.sql.SQLException
getXAResource in interface javax.sql.XAConnectionjava.sql.SQLException
public final void start(javax.transaction.xa.Xid xid,
int flags)
throws javax.transaction.xa.XAException
start in interface javax.transaction.xa.XAResourcexid - A global transaction identifier to be associated with the
resourceflags - One of TMNOFLAGS, TMJOIN, or TMRESUME
javax.transaction.xa.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.
public final void end(javax.transaction.xa.Xid xid,
int flags)
throws javax.transaction.xa.XAException
If TMSUSPEND is specified in flags, the transaction branch is temporarily suspended in incomplete state. The transaction context is in suspened state and must be resumed via start 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.
end in interface javax.transaction.xa.XAResourcexid - A global transaction identifier that is the same as what was
used previously in the start method.flags - One of TMSUCCESS, TMFAIL, or TMSUSPEND
javax.transaction.xa.XAException - An error has occurred.
Possible XAException values are XAER_RMERR, XAER_RMFAILED, XAER_NOTA,
XAER_INVAL, XAER_PROTO, or XA_RB*.
public final int prepare(javax.transaction.xa.Xid xid)
throws javax.transaction.xa.XAException
prepare in interface javax.transaction.xa.XAResourcexid - A global transaction identifier
javax.transaction.xa.XAException - An error has occurred. Possible exception values
are: XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or
XAER_PROTO.
public final void commit(javax.transaction.xa.Xid xid,
boolean onePhase)
throws javax.transaction.xa.XAException
commit in interface javax.transaction.xa.XAResourcexid - A global transaction identifieronePhase - If true, the resource manager should use a one-phase
commit protocol to commit the work done on behalf of xid.
javax.transaction.xa.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 paramether onePhase 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 and has released all held resources.
public final void rollback(javax.transaction.xa.Xid xid)
throws javax.transaction.xa.XAException
rollback in interface javax.transaction.xa.XAResourcexid - A global transaction identifier
javax.transaction.xa.XAException - - An error has occurred
public final javax.transaction.xa.Xid[] recover(int flag)
throws javax.transaction.xa.XAException
recover in interface javax.transaction.xa.XAResourceflag - One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS must
be used when no other flags are set in flags.
javax.transaction.xa.XAException - An error has occurred. Possible values are
XAER_RMERR, XAER_RMFAIL, XAER_INVAL, and XAER_PROTO.
public final void forget(javax.transaction.xa.Xid xid)
throws javax.transaction.xa.XAException
forget in interface javax.transaction.xa.XAResourcexid - A global transaction identifier
javax.transaction.xa.XAException - An error has occurred. Possible exception values
are XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.
public final boolean isSameRM(javax.transaction.xa.XAResource xares)
throws javax.transaction.xa.XAException
isSameRM in interface javax.transaction.xa.XAResourcexares - An XAResource object whose resource manager instance is to
be compared with the resource manager instance of the target object.
javax.transaction.xa.XAException - An error has occurred. Possible exception values
are XAER_RMERR, XAER_RMFAIL.public int getTransactionTimeout()
getTransactionTimeout in interface javax.transaction.xa.XAResourcepublic boolean setTransactionTimeout(int seconds)
setTransactionTimeout in interface javax.transaction.xa.XAResourceseconds - the transaction timeout value in seconds.
javax.transaction.xa.XAException - - An error has occurred. Possible exception
values are XAER_RMERR, XAER_RMFAIL, or XAER_INVAL.
public void checkAutoCommit(boolean autoCommit)
throws java.sql.SQLException
checkAutoCommit in interface BrokeredConnectionControlcheckAutoCommit in class EmbedPooledConnectionjava.sql.SQLException
public void checkHoldCursors(int holdability)
throws java.sql.SQLException
checkHoldCursors in interface BrokeredConnectionControlcheckHoldCursors in class EmbedPooledConnectionjava.sql.SQLException
public void checkSavepoint()
throws java.sql.SQLException
checkSavepoint in interface BrokeredConnectionControlcheckSavepoint in class EmbedPooledConnectionjava.sql.SQLException
public void checkRollback()
throws java.sql.SQLException
checkRollback in interface BrokeredConnectionControlcheckRollback in class EmbedPooledConnectionjava.sql.SQLException
public void checkCommit()
throws java.sql.SQLException
checkCommit in interface BrokeredConnectionControlcheckCommit in class EmbedPooledConnectionjava.sql.SQLException
public java.sql.Connection getConnection()
throws java.sql.SQLException
EmbedPooledConnection
getConnection in interface javax.sql.PooledConnectiongetConnection in class EmbedPooledConnectionjava.sql.SQLException - - if a database-access error occurs.
public java.sql.Statement wrapStatement(java.sql.Statement s)
throws java.sql.SQLException
wrapStatement in interface BrokeredConnectionControlwrapStatement in class EmbedPooledConnectionjava.sql.SQLException
public java.sql.PreparedStatement wrapStatement(java.sql.PreparedStatement ps,
java.lang.String sql,
java.lang.Object generatedKeys)
throws java.sql.SQLException
wrapStatement in interface BrokeredConnectionControlwrapStatement in class EmbedPooledConnectionjava.sql.SQLException
public java.sql.CallableStatement wrapStatement(java.sql.CallableStatement cs,
java.lang.String sql)
throws java.sql.SQLException
wrapStatement in interface BrokeredConnectionControlwrapStatement in class EmbedPooledConnectionjava.sql.SQLException
public java.sql.Connection getRealConnection()
throws java.sql.SQLException
getRealConnection in interface BrokeredConnectionControlgetRealConnection in class EmbedPooledConnectionjava.sql.SQLExceptionprivate XATransactionState getTransactionState(XAXactId xid_im)
private static javax.transaction.xa.XAException wrapInXAException(java.sql.SQLException se)
private static javax.transaction.xa.XAException wrapInXAException(StandardException se)
void removeXATransaction(XAXactId xid_im)
private void returnConnectionToResource(XATransactionState tranState,
XAXactId xid_im)
private void checkXAActive()
throws javax.transaction.xa.XAException
javax.transaction.xa.XAException
private void checkUserCredentials(EmbedXAConnection original)
throws javax.transaction.xa.XAException
javax.transaction.xa.XAExceptionprivate static void closeUnusedConnection(EmbedConnection conn)
java.lang.String getUsername()
java.lang.String getPassword()
protected final void openRealConnection()
throws java.sql.SQLException
java.sql.SQLExceptionprotected final java.sql.Connection getNewCurrentConnectionHandle()
protected void closeCurrentConnectionHandle()
throws java.sql.SQLException
java.sql.SQLException
protected void resetRealConnection()
throws java.sql.SQLException
java.sql.SQLException
public void close()
throws java.sql.SQLException
close in interface javax.sql.PooledConnectionjava.sql.SQLException - - if a database-access error occurs.public final void addConnectionEventListener(javax.sql.ConnectionEventListener listener)
addConnectionEventListener in interface javax.sql.PooledConnectionpublic final void removeConnectionEventListener(javax.sql.ConnectionEventListener listener)
removeConnectionEventListener in interface javax.sql.PooledConnectionpublic void notifyError(java.sql.SQLException exception)
public void notifyClose()
protected final void checkActive()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void notifyException(java.sql.SQLException sqle)
notifyException in interface BrokeredConnectionControl
public boolean closingConnection()
throws java.sql.SQLException
closingConnection in interface BrokeredConnectionControljava.sql.SQLExceptionpublic void setDrdaID(java.lang.String drdaID)
setDrdaID in interface BrokeredConnectionControldrdaID - drda connection identifier
public void setPrepareIsolation(int level)
throws java.sql.SQLException
setPrepareIsolation in interface BrokeredConnectionControllevel - internal isolation level
java.sql.SQLExceptionBrokeredConnection.setPrepareIsolation(int)
public int getPrepareIsolation()
throws java.sql.SQLException
getPrepareIsolation in interface BrokeredConnectionControljava.sql.SQLExceptionpublic java.lang.String toString()
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||