Beispiel #1
0
        private static TransactionContinuation CreateNodeAndKeepTxOpen(HighlyAvailableGraphDatabase db, Label label)
        {
            TransactionContinuation txc = new TransactionContinuation(db);

            txc.Begin();
            Db.createNode(label);
            txc.Suspend();
            return(txc);
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void creatingIndexOnMasterShouldHaveSlavesBuildItAsWell()
        public virtual void CreatingIndexOnMasterShouldHaveSlavesBuildItAsWell()
        {
            // GIVEN
            HighlyAvailableGraphDatabase slave1 = Cluster.AnySlave;
            HighlyAvailableGraphDatabase slave2 = Cluster.getAnySlave(slave1);

            Label label = label("Person");

            // WHEN
            TransactionContinuation txOnSlave1 = CreateNodeAndKeepTxOpen(slave1, label);
            TransactionContinuation txOnSlave2 = CreateNodeAndKeepTxOpen(slave2, label);

            Commit(txOnSlave1);
            Commit(txOnSlave2);

            // THEN
            assertEquals(GetLabelId(slave1, label), GetLabelId(slave2, label));
        }
Beispiel #3
0
 private static void Commit(TransactionContinuation txc)
 {
     txc.Resume();
     txc.Commit();
 }