Example usage for org.hibernate.resource.transaction.spi TransactionStatus COMMITTING

List of usage examples for org.hibernate.resource.transaction.spi TransactionStatus COMMITTING

Introduction

In this page you can find the example usage for org.hibernate.resource.transaction.spi TransactionStatus COMMITTING.

Prototype

TransactionStatus COMMITTING

To view the source code for org.hibernate.resource.transaction.spi TransactionStatus COMMITTING.

Click Source Link

Document

Status code indicating a transaction that has begun the second phase of the two-phase commit protocol, but not yet completed this phase.

Usage

From source file:org.glite.security.voms.admin.integration.orgdb.tools.OrgDBUtil.java

License:Apache License

public OrgDBUtil(String[] args) throws ParseException, FileNotFoundException, IOException {

    setupCLParser();//ww w  .  j  a v a 2s.  c  om
    parseCommandLine(args);
    initializeDatabase();
    execute();

    Transaction tx = OrgDBSessionFactory.getSessionFactory().getCurrentSession().getTransaction();
    TransactionStatus status = tx.getStatus();
    if (tx.isActive() && !status.equals(TransactionStatus.COMMITTED)
            && !status.equals(TransactionStatus.COMMITTING)) {
        tx.commit();
    }
}