예제 #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: protected <T> org.neo4j.graphdb.Result executeWithRetries(String query, T parameters, org.neo4j.kernel.impl.query.TransactionalContext context, ParametrizedQueryExecutor<T> executor) throws org.neo4j.kernel.impl.query.QueryExecutionKernelException
        protected internal virtual Result ExecuteWithRetries <T>(string query, T parameters, TransactionalContext context, ParametrizedQueryExecutor <T> executor)
        {
            VersionContext versionContext = GetCursorContext(context);
            EagerResult    eagerResult;
            int            attempt = 0;
            bool           dirtySnapshot;

            do
            {
                if (attempt == _maxQueryExecutionAttempts)
                {
                    return(ThrowQueryExecutionException("Unable to get clean data snapshot for query '%s' after %d attempts.", query, attempt));
                }
                attempt++;
                versionContext.InitRead();
                Result result = executor(query, parameters, context);
                eagerResult = new EagerResult(result, versionContext);
                eagerResult.Consume();
                dirtySnapshot = versionContext.Dirty;
                if (dirtySnapshot && result.QueryStatistics.containsUpdates())
                {
                    return(ThrowQueryExecutionException("Unable to get clean data snapshot for query '%s' that perform updates.", query, attempt));
                }
            } while (dirtySnapshot);
            return(eagerResult);
        }
예제 #2
0
 internal EagerQueryResult(EagerResult outerInstance)
 {
     this._outerInstance = outerInstance;
     Fields = outerInstance.originalResult.Columns().ToArray();
 }
예제 #3
0
 internal EagerResultResourceIterator(EagerResult outerInstance, string column)
 {
     this._outerInstance = outerInstance;
     this.Column         = column;
 }