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

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


  }

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

    ODocument doc = new ODocument(db, "Account");
    doc.field("version", 0);
    doc.save();
View Full Code Here


  }

  @Test(dependsOnMethods = "testTransactionOptimisticCacheMgmt2Db")
  public void testTransactionMultipleRecords() throws IOException {
    ODatabaseDocumentTx db = new ODatabaseDocumentTx(url);
    db.open("admin", "admin");

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

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

  @SuppressWarnings("unchecked")
  @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");
View Full Code Here

    jack.save();

    db.commit();

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

    ODocument loadedJack = db.load(jack.getIdentity());
    Assert.assertEquals(loadedJack.field("name"), "Jack");
    Collection<ODocument> jackFollowings = loadedJack.field("following");
    Assert.assertNotNull(jackFollowings.size());
View Full Code Here

  }

  @Test
  public void testDbExport() throws IOException {
    ODatabaseDocumentTx database = new ODatabaseDocumentTx(url);
    database.open("admin", "admin");

    ODatabaseExport export = new ODatabaseExport(database, testPath + "/" + EXPORT_FILE_PATH, this);
    export.exportDatabase();
    export.close();
View Full Code Here

  }

  @Test
  public void setup() throws IOException {
    ODatabaseDocumentTx database = new ODatabaseDocumentTx(url);
    database.open("admin", "admin");

    long tot = database.countClass("Account");

    // DELETE ALL THE Account OBJECTS
    int i = 0;
View Full Code Here

  }

  @Test(dependsOnMethods = "setup")
  public void createRecords() throws IOException {
    ODatabaseDocumentTx database = new ODatabaseDocumentTx(url);
    database.open("admin", "admin");

    ODocument record1 = new ODocument(database, "Account");
    record1.field("name", "Creation test").save();

    ODocument record2 = new ODocument(database, "Account");
View Full Code Here

  }

  @Test(dependsOnMethods = "createRecords")
  public void testTransactionRecovery() throws IOException {
    ODatabaseDocumentTx db1 = new ODatabaseDocumentTx(url);
    db1.open("admin", "admin");

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

    db1.begin();
View Full Code Here

  }

  @Test(dependsOnMethods = "testTransactionOptimisticCacheMgmt2Db")
  public void testTransactionMultipleRecords() throws IOException {
    ODatabaseDocumentTx db = new ODatabaseDocumentTx(url);
    db.open("admin", "admin");

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

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

  }

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

    ODocument doc = new ODocument(db, "Account");
    doc.field("version", 0);
    doc.save();
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.