Example usage for javax.persistence TransactionRequiredException TransactionRequiredException

List of usage examples for javax.persistence TransactionRequiredException TransactionRequiredException

Introduction

In this page you can find the example usage for javax.persistence TransactionRequiredException TransactionRequiredException.

Prototype

public TransactionRequiredException(String message) 

Source Link

Document

Constructs a new TransactionRequiredException exception with the specified detail message.

Usage

From source file:com.impetus.kundera.persistence.EntityManagerImpl.java

@Override
public final void joinTransaction() {
    checkClosed();//from   ww  w.j  av  a2  s  .c o  m
    if (this.utx != null) {
        return;
    } else {
        throw new TransactionRequiredException("No transaction in progress");
    }
}

From source file:com.impetus.kundera.persistence.EntityManagerImpl.java

private void checkTransactionNeeded() {
    onLookUp(transactionType);//  w  ww .jav a2 s. c o m

    if ((getPersistenceContextType() != PersistenceContextType.TRANSACTION)
            || (getPersistenceDelegator().isTransactionInProgress())) {
        return;
    }
    throw new TransactionRequiredException(
            "no transaction is in progress for a TRANSACTION type persistence context");
}

From source file:org.batoo.jpa.core.impl.manager.EntityManagerImpl.java

/**
 * Asserts that a transaction is active.
 * //from   www .j  av  a  2 s. com
 * @since 2.0.0
 */
public void assertTransaction() {
    this.assertOpen();

    if ((this.transaction == null) || !this.transaction.isActive()) {
        throw new TransactionRequiredException("No active transaction");
    }
}

From source file:org.castor.jpa.CastorEntityManager.java

/**
 * Verifies that an {@link EntityTransaction} is active.
 *//* w  w  w.j a  v a2  s .c om*/
private void verifyRunningTransaction() {
    if (!this.entityTransaction.isActive()) {
        throw new TransactionRequiredException("Method called while no EntityTransaction was running.");
    }
}