[hibernate-dev] Transaction

Steve Ebersole steve at hibernate.org
Wed Mar 25 13:19:33 EDT 2015


I thought I had asked this before, but maybe not.  Andrea and I are working
through the transaction/jdbc changes and I really would like to clean up
the org.hibernate.Transaction API.  But before I start cutting I wanted to
make sure noone is using the methods I plan on getting rid of...

Here is the new proposed contract:

public interface Transsaction {
    public void begin();
    public void commit();
    public void rollback();
    public void markRollbackOnly();

    public Status getStatus();

    public int getTimeout();
    public void setTimeout(int seconds);

    public void registerSynchronization(Synchronization synchronization);
}

public enum Status {
  NOT_ACTIVE,
  ACTIVE,
  COMMITTED,
  ROLLED_BACK,
    FAILED_COMMIT
}

Notes:
1) isInitiator() has been removed with no real replacement.  I could not
really see when that would be useful.
2) isParticipating() has been removed with no real replacement.
2) isActive(), wasCommitted() and wasRolledBack has all been removed with
call to getStatus() as replacement
3) getLocalStatus() is gone.  Who cares :)  If users are asking us this, we
really should be checking the REAL state of the transaction
4) Transaction is now a single impl.  The distinctions are all handled
internally.  TransactionImplementor is gone too.

Thoughts?  Concerns?


More information about the hibernate-dev mailing list