public void Rollback()
{
CheckForOpenTransaction();
// we have to check for an empty endpoint because we dont have one until our first request
if (Endpoint == null)
{
CleanupAfterClosedTransaction();
return;
}
//This change is due to: https://github.com/Readify/Neo4jClient/issues/127 and https://github.com/neo4j/neo4j/issues/5806 -
HttpStatusCode[] expectedStatusCodes = {HttpStatusCode.OK};
if (_client.CypherCapabilities.AutoRollsBackOnError && _client.ExecutionConfiguration.HasErrors)
expectedStatusCodes = new [] {HttpStatusCode.OK, HttpStatusCode.NotFound};
Request.With(_client.ExecutionConfiguration)
.Delete(Endpoint)
.WithExpectedStatusCodes(expectedStatusCodes)
.Execute();
CleanupAfterClosedTransaction();
}