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

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


    final List<ODocument> resultBeforeCommit = db.query(new OSQLSynchQuery<ODocument>(
        "select from index:idxTransactionUniqueIndexTest"));
    Assert.assertEquals(resultBeforeCommit.size(), 1);

    db.begin();

    try {
      ODocument docOne = new ODocument("TransactionUniqueIndexTest");
      docOne.field("label", "B");
      docOne.save();
View Full Code Here


      if (operations == null || operations.isEmpty())
        throw new IllegalArgumentException("Input JSON has no operations to execute");

      if (tx)
        db.begin();

      // BROWSE ALL THE OPERATIONS
      for (Map<Object, Object> operation : operations) {
        final String type = (String) operation.get("type");
View Full Code Here

    final List<ODocument> resultBeforeCommit = db.query(new OSQLSynchQuery<ODocument>(
        "select from  index:TransactionUniqueIndexWithDotTest.label"));
    Assert.assertEquals(resultBeforeCommit.size(), 1);

    long countClassBefore = db.countClass("TransactionUniqueIndexWithDotTest");
    db.begin();
    try {
      ODocument docTwo = new ODocument("TransactionUniqueIndexWithDotTest");
      docTwo.field("label", "A");
      docTwo.save();
View Full Code Here

    final List<ODocument> resultBeforeCommit = db.query(new OSQLSynchQuery<ODocument>(
        "select from index:TransactionUniqueIndexWithDotTest.label"));
    Assert.assertEquals(resultBeforeCommit.size(), 1);

    db.begin();

    try {
      ODocument docOne = new ODocument("TransactionUniqueIndexWithDotTest");
      docOne.field("label", "B");
      docOne.save();
View Full Code Here

    v0.field("counter", 0);
    v0.save();
    idx.put(0, v0);
    Assert.assertTrue(idx.contains(0));

    db.begin(OTransaction.TXTYPE.OPTIMISTIC);
    ODocument v = new ODocument("ManualIndexTxClass");
    v.field("counter", 52);
    v.save();

    ODocument v2 = new ODocument("ManualIndexTxClass");
View Full Code Here

    v0.field("counter", 0);
    v0.save();
    idx.put(0, v0);
    Assert.assertTrue(idx.contains(0));

    db.begin(OTransaction.TXTYPE.OPTIMISTIC);
    ODocument v = new ODocument("ManualIndexTxRecursiveStoreClass");
    v.field("counter", 52);

    ODocument v2 = new ODocument("ManualIndexTxRecursiveStoreClass");
    v2.field("counter", 54);
View Full Code Here

    Orient.instance().getProfiler().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("Employee");
    for (int i = 0; i < DOCUMENTS; ++i) {
View Full Code Here

        long value = transactionalCreateCounter.getAndIncrement();
        while (value < TRANSACTIONAL_DOCUMENT_COUNT) {
          Thread.sleep(200);

          database.begin();
          ODocument document = new ODocument(TRANSACTIONAL_WORD + STUDENT_CLASS_NAME);
          document.field("counter", value);
          document.save();

          database.commit();
View Full Code Here

      g.checkForGraphSchema(db);

      if (txActive)
        // REOPEN IT AGAIN
        db.begin();

    }

    if (intent != null)
      g.declareIntent(intent.copy());
View Full Code Here

        String newName = parentName;
        newName += Character.toString(startLetter);
        StringBuilder newIdentifier = new StringBuilder(newName);
        newIdentifier.setCharAt(0, 'B');

        db.begin();

        PersonTree tree = new PersonTree();
        tree.SetRoot(parent);

        ODocument child = tree.AddChild(parent, newName, newIdentifier.toString());
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.