Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rollback syntax in Testing doc #1723

Open
wants to merge 1 commit into
base: 11
Choose a base branch
from

Conversation

danielmbarlow
Copy link

When using the suggested code from the documuentation:

# For the `neo4j` gem
config.around do |example|
  ActiveGraph::Base.transaction do |tx|
    example.run
    tx.failure
  end
end

We get this error:

NoMethodError:
       undefined method `failure' for an instance of Neo4j::Driver::Internal::InternalTransaction

The syntax is apparently now tx.rollback, however when the transaction has already been rolled back we get this error

     Neo4j::Driver::Exceptions::ClientException:
       Can't rollback, transaction has been rolled back

This pull request changes the documention to recommend:

  • Usage of the new syntax for rollback
  • A check to see if the transaction is open before rolling it back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant