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

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


      ODocument docTwo = new ODocument("TransactionUniqueIndexWithDotTest");
      docTwo.field("label", "B");
      docTwo.save();

      db.commit();
      Assert.fail();
    } catch (OResponseProcessingException e) {
      Assert.assertTrue(e.getCause() instanceof ORecordDuplicatedException);
      db.rollback();
    } catch (ORecordDuplicatedException oie) {
View Full Code Here


    Assert.assertNotNull(idx);
    idx.remove(0);
    idx.put(52, v);

    db.commit();

    Assert.assertTrue(idx.contains(52));
    Assert.assertFalse(idx.contains(0));
    Assert.assertTrue(idx.get(52).getIdentity().isPersistent());
    Assert.assertEquals(idx.get(52).getIdentity(), v.getIdentity());
View Full Code Here

    idx.remove(0);

    idx.put(52, v);
    idx.put(54, v2);

    db.commit();

    Assert.assertTrue(idx.contains(52));
    Assert.assertTrue(idx.contains(54));

    Assert.assertFalse(idx.contains(0));
View Full Code Here

            .warn(
                this,
                "Requested command '%s' must be executed outside active transaction: the transaction will be committed and reopen right after it. To avoid this behavior execute it outside a transaction",
                msg.toString());
      }
      raw.commit();
      committed = true;
    } else
      committed = false;

    try {
View Full Code Here

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

          database.commit();
          if (value % 10 == 0)
            System.out.println(Thread.currentThread() + " : document " + value + " added");

          value = transactionalCreateCounter.getAndIncrement();
        }
View Full Code Here

      final ODatabaseDocumentTx db = g.getRawGraph();
      boolean txActive = db.getTransaction().isActive();

      if (txActive)
        // COMMIT TX BEFORE ANY SCHEMA CHANGES
        db.commit();

      g.checkForGraphSchema(db);

      if (txActive)
        // REOPEN IT AGAIN
View Full Code Here

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

        ODocument child = tree.AddChild(parent, newName, newIdentifier.toString());
        buildTree(tree, child.getIdentity(), newName, subnodes, depth - 1, startLetter);
        db.commit();
        break;

      } catch (ONeedRetryException e) {
        System.out.println("Concurrency change, retry " + i);
      } catch (Exception ex) {
View Full Code Here

              db.delete(d);
            }
          }
        }
        parent.save();
        db.commit();
        break;

      } catch (ONeedRetryException e) {
        System.out.println("Concurrency change, retry " + i);
      } catch (Exception ex) {
View Full Code Here

      // POPULATE TREE
      db.begin();
      PersonTree tree = new PersonTree();
      tree.AddRoot("A", "B");
      buildTree(tree, tree.root.getIdentity(), "A", subnodes, depth, 'A');
      db.commit();

      char startLetter = 'A' + subnodes;
      try {
        AddThread t1 = new AddThread("A", startLetter++);
        DeleteThread t2 = new DeleteThread("A");
View Full Code Here

            .instance()
            .warn(this,
                "Committing the active transaction to %s. To avoid this behavior do it outside the transaction",
                msg.toString());
      }
      raw.commit();
      committed = true;
    } else
      committed = false;

    try {
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.