Package com.isomorphic.hibernate
Class HBConnectionHolder
java.lang.Object
com.isomorphic.hibernate.HBConnectionHolder
Holds
Session and current transaction. Instance of this class is used to store connection information in RPCManager while handling Automatic Transactions.-
Method Summary
Modifier and TypeMethodDescriptionintReturns count of operations executed.org.hibernate.SessionReturnsSessionfor this connection.org.hibernate.TransactionReturns current open transaction.voidIncreases operations count by 1.voidsetSession(org.hibernate.Session em) Sets newSession.voidsetTransaction(org.hibernate.Transaction tx) Sets new transaction.
-
Method Details
-
getSession
public org.hibernate.Session getSession()ReturnsSessionfor this connection.- Returns:
Sessionfor this connection.
-
setSession
public void setSession(org.hibernate.Session em) Sets newSession.- Parameters:
em-Sessionnew session.
-
getTransaction
public org.hibernate.Transaction getTransaction()Returns current open transaction.- Returns:
Transactioncurrent transaction.
-
setTransaction
public void setTransaction(org.hibernate.Transaction tx) Sets new transaction.- Parameters:
tx-Transactionnew transaction.
-
getOpCount
public int getOpCount()Returns count of operations executed.- Returns:
intexecuted operations count.
-
increaseOpCount
public void increaseOpCount()Increases operations count by 1.
-