コード例 #1
0
 private void DropIndex(IndexDefinition index)
 {
     using (Transaction tx = _db.beginTx())
     {
         index.Drop();
         tx.Success();
     }
 }
コード例 #2
0
ファイル: IndexRestartIT.cs プロジェクト: Neo4Net/Neo4Net
 private void DropIndex(IndexDefinition index, DoubleLatch populationCompletionLatch)
 {
     using (Transaction tx = _db.beginTx())
     {
         index.Drop();
         populationCompletionLatch.Finish();
         tx.Success();
     }
 }
コード例 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void droppingAnUnexistingIndexShouldGiveHelpfulExceptionInSameTransaction()
        public virtual void DroppingAnUnexistingIndexShouldGiveHelpfulExceptionInSameTransaction()
        {
            // GIVEN
            IndexDefinition index = createIndex(_db, _label, _propertyKey);

            // WHEN
            using (Transaction tx = _db.beginTx())
            {
                index.Drop();
                try
                {
                    index.Drop();
                    fail("Should not be able to drop index twice");
                }
                catch (ConstraintViolationException e)
                {
                    assertThat(e.Message, containsString("No such INDEX ON :MY_LABEL(my_property_key)."));
                }
                tx.Success();
            }

            // THEN
            assertThat("Index should have been deleted", getIndexes(_db, _label), not(contains(index)));
        }