|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lumis.portal.dao.hibernate.TransactionHibernate
public class TransactionHibernate
Implements a transaction object
Constructor Summary | |
---|---|
TransactionHibernate()
|
Method Summary | |
---|---|
boolean |
addObserver(ITransactionObserver observer)
Adds an observer for this transaction. |
void |
begin()
|
void |
commit()
|
void |
dispose()
|
protected void |
finalize()
|
Object |
getAttribute(String name)
Returns the value of the named attribute, or null if no
attribute of the given name exists. |
long |
getBeginTimeMillis()
Returns the time when this transaction began in milliseconds since January 1, 1970 UTC. |
ITransaction |
getByConnectionId(String id)
Returns an ITransaction that represents the same transaction but
that returns the connection with the given id as default. |
Connection |
getConnection()
Returns the default jdbc connection for this transaction. |
Connection |
getConnection(String databaseId)
Returns the jdbc connection associated with the specified id. |
org.hibernate.Session |
getSession()
Returns the default hibernate session for this transaction. |
org.hibernate.Session |
getSession(String databaseId)
Returns the hibernate session associated with the specified database. |
boolean |
isActive()
Returns true if the transaction is currently active, false otherwise. |
void |
removeAttribute(String name)
Removes an attribute from this transaction. |
boolean |
removeObserver(ITransactionObserver observer)
Removes an observer for this transaction. |
void |
rollback()
|
void |
setAttribute(String name,
Object value)
Stores an attribute in this transaction. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TransactionHibernate()
Method Detail |
---|
public org.hibernate.Session getSession() throws DaoException
ITransactionHibernate
getSession
in interface ITransactionHibernate
DaoException
public org.hibernate.Session getSession(String databaseId) throws DaoException
ITransactionHibernate
getSession
in interface ITransactionHibernate
databaseId
- the database id.
DaoException
public void dispose() throws DaoException
dispose
in interface ITransaction
DaoException
protected void finalize() throws Throwable
finalize
in class Object
Throwable
public boolean isActive()
ITransaction
isActive
in interface ITransaction
public void begin() throws DaoException
begin
in interface ITransaction
DaoException
public void commit() throws DaoException
commit
in interface ITransaction
DaoException
public void rollback() throws DaoException
rollback
in interface ITransaction
DaoException
public Connection getConnection() throws DaoException
ITransactionJdbc
getConnection
in interface ITransactionJdbc
DaoException
public Connection getConnection(String databaseId) throws DaoException
ITransactionJdbc
getConnection
in interface ITransactionJdbc
databaseId
- the connection id.
DaoException
public ITransaction getByConnectionId(String id) throws DaoException
ITransaction
ITransaction
that represents the same transaction but
that returns the connection with the given id as default. How the id
represents the connection is defined by the concrete class that
implements this interface.
getByConnectionId
in interface ITransaction
id
- the connection id.
DaoException
public boolean addObserver(ITransactionObserver observer) throws PortalException
ITransaction
addObserver
in interface ITransaction
observer
- the observer.
PortalException
public boolean removeObserver(ITransactionObserver observer) throws PortalException
ITransaction
removeObserver
in interface ITransaction
observer
- the observer.
PortalException
public long getBeginTimeMillis()
public Object getAttribute(String name)
ITransaction
null
if no
attribute of the given name exists.
Different transaction instances that refer to the same transaction
(see ITransaction.getByConnectionId(String)
) share the same attributes.
getAttribute
in interface ITransaction
name
- the name of the attribute.
public void setAttribute(String name, Object value)
ITransaction
null
, the effect is the same as calling
ITransaction.removeAttribute(String)
.
setAttribute
in interface ITransaction
name
- the name of the attribute.value
- the value to be stored.public void removeAttribute(String name)
ITransaction
removeAttribute
in interface ITransaction
name
- the name of the attribute.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |