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

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


    long totalAccounts = db.countClusterElements("Account");

    String json = "{ \"@class\": \"Account\", \"type\": \"Residence\", \"street\": \"Piazza di Spagna\"}";

    db.begin(TXTYPE.OPTIMISTIC);
    for (int g = 0; g < 1000; g++) {
      ODocument doc = new ODocument(db, "Account");
      doc.fromJSON(json);
      doc.field("nr", g);
View Full Code Here


  @Test
  public void createGraphInTx() {
    ODatabaseDocumentTx db = new ODatabaseDocumentTx(url);
    db.open("admin", "admin");

    db.begin();

    ODocument kim = new ODocument(db, "Profile").field("name", "Kim").field("surname", "Bauer");
    ODocument teri = new ODocument(db, "Profile").field("name", "Teri").field("surname", "Bauer");
    ODocument jack = new ODocument(db, "Profile").field("name", "Jack").field("surname", "Bauer");
View Full Code Here

    OProfiler.getInstance().startRecording();

    final ODatabaseDocumentTx database = new ODatabaseDocumentTx(System.getProperty("url")).open("admin", "admin");

    database.declareIntent(new OIntentMassiveInsert());
    database.begin(TXTYPE.NOTX);

    long time = System.currentTimeMillis();

    final ODocument document = new ODocument(database, "Employee");
    for (int i = 0; i < DOCUMENTS; ++i) {
View Full Code Here

    OProfiler.getInstance().startRecording();

    final ODatabaseDocumentTx database = new ODatabaseDocumentTx(System.getProperty("url")).open("admin", "admin");

    database.declareIntent(new OIntentMassiveInsert());
    database.begin(TXTYPE.NOTX);

    long time = System.currentTimeMillis();

    final ODocument document = new ODocument(database, "Employee");
    for (int i = 0; i < DOCUMENTS; ++i) {
View Full Code Here

    ODatabaseDocumentTx db1 = new ODatabaseDocumentTx(url);
    db1.open("admin", "admin");

    // long tot = db1.countClass("Account");

    db1.begin();

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

    ODocument record2 = db1.newInstance("Account");
View Full Code Here

    long totalAccounts = db.countClusterElements("Account");

    String json = "{ \"@class\": \"Account\", \"type\": \"Residence\", \"street\": \"Piazza di Spagna\"}";

    db.begin(TXTYPE.OPTIMISTIC);
    for (int g = 0; g < 1000; g++) {
      ODocument doc = new ODocument(db, "Account");
      doc.fromJSON(json);
      doc.field("nr", g);
View Full Code Here

        OClass classOne = db.getMetadata().getSchema().getClass("TestOne");
        OClass classTwo = db.getMetadata().getSchema().getClass("TestTwo");

        for (int i = 0; i < 2000; i++) {
          try {
            db.begin(OTransaction.TXTYPE.OPTIMISTIC);

            ODocument docOne = new ODocument(classOne);
            docOne.field("intProp", random.nextInt());

            byte[] stringData = new byte[256];
View Full Code Here

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

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

      db.hide(new ORecordId());
      Assert.fail();
    } catch (ODatabaseException ex) {
    }
    try {
      db.begin();
      Assert.fail();
    } catch (ODatabaseException ex) {
    }
    try {
      db.begin(OTransaction.TXTYPE.NOTX);
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.