public class SessionOnlyTransaction<T> extends java.lang.Object implements Transaction
An implementation that provides Session only transaction management. Essentially when rollback() is called the Session's clear() method is called and when commit() is called the flush() method is called.
A read-only transaction commits without flushing. It has no pending operations of its own, so the only thing a flush could write is whatever the surrounding session already had queued.
No other resource level transaction management is provided.
| Constructor and description |
|---|
SessionOnlyTransaction(T nativeInterface, Session session)Creates a read-write transaction, which flushes the session on commit. |
SessionOnlyTransaction(T nativeInterface, Session session, boolean readOnly) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
commit() |
|
public T |
getNativeTransaction() |
|
public boolean |
isActive() |
|
public void |
rollback() |
|
public void |
setTimeout(int timeout) |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Creates a read-write transaction, which flushes the session on commit.
nativeInterface - the native transaction resourcesession - the session the transaction is bound to