Examples of rollback()


Examples of com.jengine.orm.db.DBConnection.rollback()

        try {
            connection.startTransaction();
            loadData();
            throw new Exception("test!!!");
        } catch (Exception e) {
            connection.rollback();
            // checking
            check( Author.cls.count() == 0 );
            check( Library.cls.count() == 0 );
            check( Book.cls.count() == 0 );
            check( Member.cls.count() == 0 );
View Full Code Here

Examples of com.knowgate.jdc.JDCConnection.rollback()

      oConn.commit();
    } catch (Exception sqle) {
      try { if (oMBox!=null) oMBox.close(); } catch (Exception e) {}
      try { if (oStmt!=null) oStmt.close(); } catch (Exception e) {}
      try { if (oCall!=null) oCall.close(); } catch (Exception e) {}
      try { if (oConn!=null) oConn.rollback(); } catch (Exception e) {}
      throw new MessagingException (sqle.getMessage(), sqle);
    }

    if (DebugFile.trace) {
      DebugFile.decIdent();
View Full Code Here

Examples of com.orientechnologies.orient.core.db.document.ODatabaseDocument.rollback()

      db.begin(OTransaction.TXTYPE.NOTX);
      Assert.fail();
    } catch (ODatabaseException ex) {
    }
    try {
      db.rollback();
      Assert.fail();
    } catch (ODatabaseException ex) {
    }
    try {
      db.commit();
View Full Code Here

Examples of com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.rollback()

            firstDocs.add(docOne.getIdentity());
            if (docTwo != null)
              secondDocs.add(docTwo.getIdentity());

          } catch (Exception e) {
            db.rollback();
            rollbacksCount++;
          }
        }
      } finally {
        db.close();
View Full Code Here

Examples of com.orientechnologies.orient.core.db.record.ODatabaseFlat.rollback()

    db1.begin();

    ORecordFlat record1 = new ORecordFlat(db1);
    record1.value("This is the first version").save();

    db1.rollback();

    Assert.assertEquals(db1.countClusterElements("binary"), rec);

    db1.close();
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.db.record.ODatabaseRecord.rollback()

        database.commit();

      return result;
    } catch (Exception e) {
      if (txbegun)
        database.rollback();
      throw new OCommandExecutionException("Transactional command failed", e);
    }
  }
}
View Full Code Here

Examples of com.orientechnologies.orient.object.db.OObjectDatabaseTx.rollback()

      account.setName("New Name"); // change an attribute to see if the change is rolled back
      account = database.save(account);

      Assert.assertEquals(account.getAddresses().size(), 1); // before rollback this is fine because one of the books was removed

      database.rollback(); // rollback the transaction

      account = database.reload(account, true); // ignore cache, get a copy of author from the datastore
      Assert.assertEquals(account.getAddresses().size(), 2); // this is fine, author still linked to 2 books
      Assert.assertEquals(account.getName(), originalName); // name is restored
View Full Code Here

Examples of com.orientechnologies.orient.server.tx.OTransactionOptimisticProxy.rollback()

     } catch (OTransactionAbortedException e) {
       // TX ABORTED BY THE CLIENT
     } catch (Exception e) {
       // Error during TX initialization, possibly index constraints violation.
       if (tx.isActive())
         tx.rollback(true, -1);

       sendErrorOrDropConnection(clientTxId, e);
     }
   }
View Full Code Here

Examples of com.persistit.Transaction.rollback()

        super.rollback();
        synchronized (this) {
            assign();
            Transaction tx = db.getTransaction();
            if (tx.isActive() && !tx.isCommitted()) {
                tx.rollback();
            }
            tx.end();
            close();
        }
    }
View Full Code Here

Examples of com.ponysdk.core.stm.Txn.rollback()

                        }
                    }
                    txn.commit();
                } catch (final Throwable e) {
                    log.error("Cannot process open socket", e);
                    txn.rollback();
                }
            } finally {
                end();
            }
        } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.