|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.jonas.dbm.JManagedConnection
This class represents the physical connection, managed by the pool. It implements the PooledConnection interface, in fact via the derived XAConnection interface.
Field Summary |
Fields inherited from interface javax.transaction.xa.XAResource |
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY |
Constructor Summary | |
JManagedConnection(java.sql.Connection conn,
ConnectionManager ds)
|
Method Summary | |
void |
addConnectionEventListener(javax.sql.ConnectionEventListener listener)
Add an event listener. |
void |
afterCompletion(int status)
synchronization implementation |
void |
beforeCompletion()
synchronization implementation |
void |
close()
Close the database connection. |
void |
commit(javax.transaction.xa.Xid xid,
boolean onePhase)
Commit the global transaction specified by xid. |
int |
compareTo(java.lang.Object o)
|
void |
end(javax.transaction.xa.Xid xid,
int flags)
Ends the work performed on behalf of a transaction branch. |
void |
enlistConnection(javax.transaction.Transaction transaction)
implementation of resource manager event |
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. |
int |
getIdent()
|
int |
getOpenCount()
|
java.lang.String |
getRMID()
|
int |
getTransactionTimeout()
Obtain the current transaction timeout value set for this XAResource instance. |
javax.transaction.Transaction |
getTx()
|
javax.transaction.xa.XAResource |
getXAResource()
Return an XA resource to the caller. |
void |
hold()
Notify as opened |
boolean |
inactive()
Check if the connection has been unused for too long time. |
boolean |
isAged()
|
boolean |
isClosed()
|
boolean |
isOpen()
|
boolean |
isRME()
|
boolean |
isSameRM(javax.transaction.xa.XAResource xares)
Determine if the resource manager instance represented by the target object is the same as the resource manager instance represented by the parameter xares |
void |
notifyClose()
|
void |
notifyError(java.sql.SQLException ex)
|
void |
notifyPsClose(JStatement ps)
A PreparedStatement has been logically closed. |
int |
prepare(javax.transaction.xa.Xid xid)
Ask the resource manager to prepare for a transaction commit of the transaction specified in xid. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
Try to find a PreparedStatement in the pool |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Try to find a PreparedStatement in the pool |
int |
psNumber()
|
javax.transaction.xa.Xid[] |
recover(int flag)
Obtain a list of prepared transaction branches from a resource manager. |
boolean |
release()
notify as closed |
void |
remove()
remove this item, ignoring exception on close. |
void |
removeConnectionEventListener(javax.sql.ConnectionEventListener listener)
Remove an event listener. |
void |
rollback(javax.transaction.xa.Xid xid)
Inform the resource manager to roll back work done on behalf of a transaction branch |
void |
setPstmtMax(int max)
Dynamically change the prepared statement pool size |
void |
setRME(boolean rme)
set/unset as RME |
boolean |
setTransactionTimeout(int seconds)
Set the current transaction timeout value for this XAResource instance. |
void |
setTx(javax.transaction.Transaction tx)
Set the associated transaction |
void |
start(javax.transaction.xa.Xid xid,
int flags)
Start work on behalf of a transaction branch specified in xid |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JManagedConnection(java.sql.Connection conn, ConnectionManager ds)
Method Detail |
public int getIdent()
public void setPstmtMax(int max)
public void commit(javax.transaction.xa.Xid xid, boolean onePhase) throws javax.transaction.xa.XAException
commit
in interface javax.transaction.xa.XAResource
xid
- transaction xidonePhase
- true if one phase commit
javax.transaction.xa.XAException
- XA protocol errorpublic void end(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
end
in interface javax.transaction.xa.XAResource
xid
- transaction xidflags
- currently unused
javax.transaction.xa.XAException
- XA protocol errorpublic void forget(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
forget
in interface javax.transaction.xa.XAResource
xid
- transaction xid
javax.transaction.xa.XAException
- XA protocol errorpublic int getTransactionTimeout() throws javax.transaction.xa.XAException
getTransactionTimeout
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
- XA protocol errorpublic boolean isSameRM(javax.transaction.xa.XAResource xares) throws javax.transaction.xa.XAException
isSameRM
in interface javax.transaction.xa.XAResource
xares
- An XAResource object
javax.transaction.xa.XAException
- XA protocol errorpublic int prepare(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
prepare
in interface javax.transaction.xa.XAResource
xid
- transaction xid
javax.transaction.xa.XAException
- XA protocol errorpublic javax.transaction.xa.Xid[] recover(int flag) throws javax.transaction.xa.XAException
recover
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
- XA protocol errorpublic void rollback(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
rollback
in interface javax.transaction.xa.XAResource
xid
- transaction xid
javax.transaction.xa.XAException
- XA protocol errorpublic boolean setTransactionTimeout(int seconds) throws javax.transaction.xa.XAException
setTransactionTimeout
in interface javax.transaction.xa.XAResource
seconds
- timeout value, in seconds.
javax.transaction.xa.XAException
- XA protocol errorpublic void start(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
start
in interface javax.transaction.xa.XAResource
xid
- transaction xid
javax.transaction.xa.XAException
- XA protocol errorpublic javax.transaction.xa.XAResource getXAResource() throws java.sql.SQLException
getXAResource
in interface javax.sql.XAConnection
java.sql.SQLException
- - if a database-access error occurspublic int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public int psNumber()
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.PooledConnection
java.sql.SQLException
- - if a database-access error occurspublic void close() throws java.sql.SQLException
close
in interface javax.sql.PooledConnection
java.sql.SQLException
- - if a database-access error occurspublic void addConnectionEventListener(javax.sql.ConnectionEventListener listener)
addConnectionEventListener
in interface javax.sql.PooledConnection
listener
- event listenerpublic void removeConnectionEventListener(javax.sql.ConnectionEventListener listener)
removeConnectionEventListener
in interface javax.sql.PooledConnection
listener
- event listenerpublic void enlistConnection(javax.transaction.Transaction transaction) throws javax.transaction.SystemException
enlistConnection
in interface org.objectweb.transaction.jta.ResourceManagerEvent
javax.transaction.SystemException
public void beforeCompletion()
beforeCompletion
in interface javax.transaction.Synchronization
public void afterCompletion(int status)
afterCompletion
in interface javax.transaction.Synchronization
public boolean isAged()
public boolean isOpen()
public int getOpenCount()
public boolean inactive()
public boolean isClosed()
public void hold()
public boolean release()
public void setTx(javax.transaction.Transaction tx)
tx
- Transactionpublic javax.transaction.Transaction getTx()
public boolean isRME()
public void setRME(boolean rme)
public void remove()
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
java.sql.SQLException
public void notifyPsClose(JStatement ps)
public java.lang.String getRMID()
public void notifyClose()
public void notifyError(java.sql.SQLException ex)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |