站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 2.1.8 正式版 API 英文文档

ManagedConnectionImpl (Hibernate API Documentation) - Hibernate 2.1.8 正式版 API 英文文档


net.sf.hibernate.jca
Class ManagedConnectionImpl

java.lang.Object
  extended bynet.sf.hibernate.jca.ManagedConnectionImpl
All Implemented Interfaces:
javax.resource.spi.ManagedConnection, XAResource

public class ManagedConnectionImpl
extends Object
implements javax.resource.spi.ManagedConnection, XAResource

Implementation of JCA Managed Connection.


Field Summary
 
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
 
Method Summary
 void addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
           
 void associateConnection(Object object)
          Associates the session handle with this managed connection
 void cleanup()
          Cleans up connection handles so they can't be used again But the physical connection is kept open
 void commit(Xid arg0, boolean arg1)
           
 void destroy()
          Closes the connection to the database
 void end(Xid arg0, int arg1)
           
 void forget(Xid arg0)
           
 Object getConnection(javax.security.auth.Subject subject, javax.resource.spi.ConnectionRequestInfo connectionRequestInfo)
          Creates and returns a new Hibernate Session.
 javax.resource.spi.LocalTransaction getLocalTransaction()
           
 PrintWriter getLogWriter()
           
 javax.resource.spi.ManagedConnectionMetaData getMetaData()
           
 int getTransactionTimeout()
           
 XAResource getXAResource()
           
 boolean isSameRM(XAResource arg0)
           
 int prepare(Xid arg0)
           
 Xid[] recover(int arg0)
           
 void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
           
 void rollback(Xid arg0)
           
 void setLogWriter(PrintWriter out)
           
 boolean setTransactionTimeout(int arg0)
           
 void start(Xid arg0, int arg1)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getConnection

public Object getConnection(javax.security.auth.Subject subject,
                            javax.resource.spi.ConnectionRequestInfo connectionRequestInfo)
                     throws javax.resource.ResourceException
Creates and returns a new Hibernate Session. Will throw a ResourceException if the session factory fails to create a session

Specified by:
getConnection in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

destroy

public void destroy()
             throws javax.resource.ResourceException
Closes the connection to the database

Specified by:
destroy in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException - cannot close connection (with the linked exception)

cleanup

public void cleanup()
             throws javax.resource.ResourceException
Cleans up connection handles so they can't be used again But the physical connection is kept open

Specified by:
cleanup in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

associateConnection

public void associateConnection(Object object)
                         throws javax.resource.ResourceException
Associates the session handle with this managed connection

Specified by:
associateConnection in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

addConnectionEventListener

public void addConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
Specified by:
addConnectionEventListener in interface javax.resource.spi.ManagedConnection

removeConnectionEventListener

public void removeConnectionEventListener(javax.resource.spi.ConnectionEventListener listener)
Specified by:
removeConnectionEventListener in interface javax.resource.spi.ManagedConnection

getXAResource

public XAResource getXAResource()
                                              throws javax.resource.ResourceException
Specified by:
getXAResource in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

getLocalTransaction

public javax.resource.spi.LocalTransaction getLocalTransaction()
                                                        throws javax.resource.ResourceException
Specified by:
getLocalTransaction in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

getMetaData

public javax.resource.spi.ManagedConnectionMetaData getMetaData()
                                                         throws javax.resource.ResourceException
Specified by:
getMetaData in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

setLogWriter

public void setLogWriter(PrintWriter out)
                  throws javax.resource.ResourceException
Specified by:
setLogWriter in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

getLogWriter

public PrintWriter getLogWriter()
                         throws javax.resource.ResourceException
Specified by:
getLogWriter in interface javax.resource.spi.ManagedConnection
Throws:
javax.resource.ResourceException

commit

public void commit(Xid arg0,
                   boolean arg1)
            throws XAException
Specified by:
commit in interface XAResource
Throws:
XAException

end

public void end(Xid arg0,
                int arg1)
         throws XAException
Specified by:
end in interface XAResource
Throws:
XAException

forget

public void forget(Xid arg0)
            throws XAException
Specified by:
forget in interface XAResource
Throws:
XAException

getTransactionTimeout

public int getTransactionTimeout()
                          throws XAException
Specified by:
getTransactionTimeout in interface XAResource
Throws:
XAException

isSameRM

public boolean isSameRM(XAResource arg0)
                 throws XAException
Specified by:
isSameRM in interface XAResource
Throws:
XAException

prepare

public int prepare(Xid arg0)
            throws XAException
Specified by:
prepare in interface XAResource
Throws:
XAException

recover

public Xid[] recover(int arg0)
                                   throws XAException
Specified by:
recover in interface XAResource
Throws:
XAException

rollback

public void rollback(Xid arg0)
              throws XAException
Specified by:
rollback in interface XAResource
Throws:
XAException

setTransactionTimeout

public boolean setTransactionTimeout(int arg0)
                              throws XAException
Specified by:
setTransactionTimeout in interface XAResource
Throws:
XAException

start

public void start(Xid arg0,
                  int arg1)
           throws XAException
Specified by:
start in interface XAResource
Throws:
XAException