Beispiel #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void close() throws org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException
        public override void Close()
        {
            _actual.close();
            try
            {
                using (IndexReader reader = _readerSupplier.get())
                {
                    foreach (ValueTuple tuple in _touchedTuples)
                    {
                        using (PrimitiveLongResourceIterator results = reader.Query(QueryOf(tuple)))
                        {
                            if (results.hasNext())
                            {
                                long firstEntityId = results.next();
                                if (results.hasNext())
                                {
                                    long secondEntityId = results.next();
                                    throw new IndexEntryConflictException(firstEntityId, secondEntityId, tuple);
                                }
                            }
                        }
                    }
                }
            }
            catch (IndexNotApplicableKernelException e)
            {
                throw new System.ArgumentException("Unexpectedly the index reader couldn't handle this query", e);
            }
        }