Package com.orientechnologies.orient.core.db.document

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


      doc.fromJSON(json);
      doc.field("nr", g);

      doc.save();
    }
    db.commit();

    Assert.assertEquals(db.countClusterElements("Account"), totalAccounts + 1000);

    db.close();
  }
View Full Code Here


    ((HashSet<ODocument>) kim.field("following", new HashSet<ODocument>()).field("following")).add(teri);
    ((HashSet<ODocument>) teri.field("following", new HashSet<ODocument>()).field("following")).add(jack);

    jack.save();

    db.commit();

    db.close();
    db.open("admin", "admin");

    ODocument loadedJack = db.load(jack.getIdentity());
View Full Code Here

    record1.field("location", "This is the first version").save();

    ODocument record2 = db1.newInstance("Account");
    record2.field("location", "This is the first version").save();

    db1.commit();

    // Assert.assertEquals(db1.getClusterSize(db1.getMetadata().getSchema().getClass("Account").getDefaultClusterId()), rec);

    db1.close();
  }
View Full Code Here

      doc.fromJSON(json);
      doc.field("nr", g);

      doc.save();
    }
    db.commit();

    Assert.assertEquals(db.countClusterElements("Account"), totalAccounts + 1000);

    db.close();
  }
View Full Code Here

      dbTx.open("admin", "admin");
      ODocument document = new ODocument();
      document.field("name", "something");
      document.field("surname", "something-else");
      document = dbTx.save(document);
      dbTx.commit();
      ODocument doc = dbTx.load(document.getIdentity());
      assertEquals(doc.fields(), document.fields());
      assertEquals(doc.field("name"), document.field("name"));
      assertEquals(doc.field("surname"), document.field("surname"));
    } finally {
View Full Code Here

      dbTx.open("admin", "admin");
      ODocument document = new ODocument();
      document.field("name", "something");
      document.field("surname", "something-else");
      document = dbTx.save(document);
      dbTx.commit();
      ODocument doc = dbTx.load(document.getIdentity());
      assertEquals(doc.fields(), document.fields());
      assertEquals(doc.field("name"), document.field("name"));
      assertEquals(doc.field("surname"), document.field("surname"));
    } finally {
View Full Code Here

              ORecordInternal.setIdentity(conflictDocTwo, new ORecordId(secondDocs.get(0)));
              conflictDocTwo.setDirty();
              conflictDocTwo.save();
            }

            db.commit();

            if (deleteIndex >= 0)
              firstDocs.remove(deleteIndex);

            firstDocs.add(docOne.getIdentity());
View Full Code Here

      db.rollback();
      Assert.fail();
    } catch (ODatabaseException ex) {
    }
    try {
      db.commit();
      Assert.fail();
    } catch (ODatabaseException ex) {
    }
    try {
      db.getMetadata();
View Full Code Here

      db.rollback();
      Assert.fail();
    } catch (ODatabaseException ex) {
    }
    try {
      db.commit();
      Assert.fail();
    } catch (ODatabaseException ex) {
    }
    try {
      db.getMetadata();
View Full Code Here

      db.rollback();
      Assert.fail();
    } catch (ODatabaseException ex) {
    }
    try {
      db.commit();
      Assert.fail();
    } catch (ODatabaseException ex) {
    }
    try {
      db.getMetadata();
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.