Search in sources :

Example 1 with Transaction

use of com.google.appengine.api.datastore.Transaction in project qi4j-sdk by Qi4j.

the class GaeEntityStoreMixin method applyChanges.

@Override
public void applyChanges(MapChanges changes) throws IOException {
    final Transaction transaction = datastore.beginTransaction();
    try {
        changes.visitMap(new GaeMapChanger(transaction));
        transaction.commit();
    } catch (RuntimeException e) {
        if (transaction.isActive()) {
            transaction.rollback();
        }
        if (e instanceof EntityStoreException) {
            throw (EntityStoreException) e;
        } else {
            throw new IOException(e);
        }
    }
}
Also used : Transaction(com.google.appengine.api.datastore.Transaction) EntityStoreException(org.qi4j.spi.entitystore.EntityStoreException) IOException(java.io.IOException)

Example 2 with Transaction

use of com.google.appengine.api.datastore.Transaction in project siena by mandubian.

the class GaePersistenceManager method commitTransaction.

public void commitTransaction() {
    Transaction txn = ds.getCurrentTransaction();
    txn.commit();
}
Also used : Transaction(com.google.appengine.api.datastore.Transaction)

Example 3 with Transaction

use of com.google.appengine.api.datastore.Transaction in project siena by mandubian.

the class GaePersistenceManager method rollbackTransaction.

public void rollbackTransaction() {
    Transaction txn = ds.getCurrentTransaction();
    txn.rollback();
}
Also used : Transaction(com.google.appengine.api.datastore.Transaction)

Aggregations

Transaction (com.google.appengine.api.datastore.Transaction)3 IOException (java.io.IOException)1 EntityStoreException (org.qi4j.spi.entitystore.EntityStoreException)1