public interface HBProviderInterface Session and transaction acquiring and handling. Implementation of this interface should provide at least two constructors:Properties - will be used if implementation is used as additional named hibernate provider| Modifier and Type | Method and Description |
|---|---|
void | commitTransaction(Transaction tx) Commits specified transaction. |
SessionFactory | get() Returns SessionFactory. |
Session | getSession() Returns Session for persistence operations. |
Transaction | getTransaction(Session session) Returns started transaction. |
void | returnSession(Session session) Closes Session. |
void | rollbackTransaction(Transaction tx) Rolls back specified transaction. |
SessionFactory get()
SessionFactory.SessionFactory.Session getSession()
throws HibernateException Session for persistence operations.Session for persistence operations.HibernateException - if unable to acquire Session.void returnSession(Session session)
Session.session - Session which should be closed.Transaction getTransaction(Session session)
throws HibernateException session - Transaction needed if joining to existing transaction or starting transaction locally.Transaction Already started transaction for persistence operations.HibernateException - if unable to acquire or open transaction.void commitTransaction(Transaction tx)
throws HibernateException tx - Transaction transaction to be committed.HibernateException - occurred while committing transaction.void rollbackTransaction(Transaction tx)
tx - Transaction transaction to be rolled back.