|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ow2.jonas.dbm.internal.cm.JManagedConnection
public class 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(Connection conn,
ConnectionManager ds)
|
Method Summary | |
---|---|
void |
addConnectionEventListener(ConnectionEventListener listener)
Add an event listener. |
void |
afterCompletion(int status)
synchronization implementation |
void |
beforeCompletion()
synchronization implementation |
void |
close()
Close the database connection. |
void |
commit(Xid xid,
boolean onePhase)
Commit the global transaction specified by xid. |
int |
compareTo(Object o)
Compare is based on the number of PrepareStatement cached in this Connection. |
void |
delistConnection(Transaction transaction)
delistConnection: used for Stateful beans at postInvoke. |
void |
end(Xid xid,
int flags)
Ends the work performed on behalf of a transaction branch. |
void |
enlistConnection(Transaction transaction)
Enlist Connection in the Transaction |
void |
forget(Xid xid)
Tell the resource manager to forget about a heuristically completed transaction branch. |
List |
getCloserThreadInfos()
|
Connection |
getConnection()
Create an object handle for a database connection. |
long |
getCreationTime()
|
int |
getIdent()
|
int |
getOpenCount()
|
List |
getOpenerThreadInfos()
|
long |
getOpeningTime()
|
String |
getRMID()
|
int |
getTransactionTimeout()
Obtain the current transaction timeout value set for this XAResource instance. |
Transaction |
getTx()
|
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(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(SQLException ex)
|
void |
notifyPsClose(JStatement ps)
A PreparedStatement has been logically closed. |
int |
prepare(Xid xid)
Ask the resource manager to prepare for a transaction commit of the transaction specified in xid. |
PreparedStatement |
prepareStatement(String sql)
Try to find a PreparedStatement in the pool |
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency)
Try to find a PreparedStatement in the pool |
int |
psNumber()
|
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(ConnectionEventListener listener)
Remove an event listener. |
void |
rollback(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(Transaction tx)
Set the associated transaction |
void |
start(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(Connection conn, ConnectionManager ds)
Method Detail |
---|
public int getIdent()
public void setPstmtMax(int max)
public void commit(Xid xid, boolean onePhase) throws XAException
commit
in interface XAResource
xid
- transaction xidonePhase
- true if one phase commit
XAException
- XA protocol errorpublic void end(Xid xid, int flags) throws XAException
end
in interface XAResource
xid
- transaction xidflags
- currently unused
XAException
- XA protocol errorpublic void forget(Xid xid) throws XAException
forget
in interface XAResource
xid
- transaction xid
XAException
- XA protocol errorpublic int getTransactionTimeout() throws XAException
getTransactionTimeout
in interface XAResource
XAException
- XA protocol errorpublic boolean isSameRM(XAResource xares) throws XAException
isSameRM
in interface XAResource
xares
- An XAResource object
XAException
- XA protocol errorpublic int prepare(Xid xid) throws XAException
prepare
in interface XAResource
xid
- transaction xid
XAException
- XA protocol errorpublic Xid[] recover(int flag) throws XAException
recover
in interface XAResource
XAException
- XA protocol errorpublic void rollback(Xid xid) throws XAException
rollback
in interface XAResource
xid
- transaction xid
XAException
- XA protocol errorpublic boolean setTransactionTimeout(int seconds) throws XAException
setTransactionTimeout
in interface XAResource
seconds
- timeout value, in seconds.
XAException
- XA protocol errorpublic void start(Xid xid, int flags) throws XAException
start
in interface XAResource
xid
- transaction xid
XAException
- XA protocol errorpublic XAResource getXAResource() throws SQLException
getXAResource
in interface XAConnection
SQLException
- - if a database-access error occurspublic int compareTo(Object o)
compareTo
in interface Comparable
public int psNumber()
public Connection getConnection() throws SQLException
getConnection
in interface PooledConnection
SQLException
- - if a database-access error occurspublic void close() throws SQLException
close
in interface PooledConnection
SQLException
- - if a database-access error occurspublic void addConnectionEventListener(ConnectionEventListener listener)
addConnectionEventListener
in interface PooledConnection
listener
- event listenerpublic void removeConnectionEventListener(ConnectionEventListener listener)
removeConnectionEventListener
in interface PooledConnection
listener
- event listenerpublic void enlistConnection(Transaction transaction) throws SystemException
enlistConnection
in interface Enlistable
transaction
- the transaction that has begun
SystemException
- if an exception occurspublic void delistConnection(Transaction transaction)
delistConnection
in interface Enlistable
transaction
- the transaction that has begunpublic void beforeCompletion()
beforeCompletion
in interface Synchronization
public void afterCompletion(int status)
afterCompletion
in interface Synchronization
public boolean isAged()
public boolean isOpen()
public int getOpenCount()
public boolean inactive()
public boolean isClosed()
public long getOpeningTime()
public long getCreationTime()
public List getOpenerThreadInfos()
public List getCloserThreadInfos()
public void hold()
public boolean release()
public void setTx(Transaction tx)
tx
- Transactionpublic Transaction getTx()
public boolean isRME()
public void setRME(boolean rme)
public void remove()
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
SQLException
public PreparedStatement prepareStatement(String sql) throws SQLException
SQLException
public void notifyPsClose(JStatement ps)
public String getRMID()
public void notifyClose()
public void notifyError(SQLException ex)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |