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

Add GQLSTATUS code to Neo. code #2008

Merged
merged 5 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Use `REVOKE` if you want to remove a privilege.

Common errors, such as misspellings or attempts to revoke privileges that have not been granted or denied, will lead to notifications.
Some of these notifications may be replaced with errors in a future major version of Neo4j.
See link:{neo4j-docs-base-uri}/status-codes/{page-version}/notifications/all-notifications[Status Codes -> Notification codes] for details on notifications.
See link:{neo4j-docs-base-uri}/status-codes/{page-version}/notifications/all-notifications[Status Codes for Errors & Notifications -> Server notifications] for details on notifications.

The hierarchy between the different database privileges is shown in the image below.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ CREATE ALIAS yard FOR DATABASE garden
Failed to create the specified database alias 'yard': Database 'garden' is composite.
----

From 5.26 onwards, the error message also contains the GQLSTATUS code `42NA6` and the status description `error: syntax error or access rule violation - invalid alias target. Aliases are not allowed to target composite databases.`

== Alter local and remote database aliases in composite databases

Local and remote database aliases belonging to a composite database can be altered using the `ALTER ALIAS` command.
Expand Down Expand Up @@ -354,6 +356,8 @@ DROP ALIAS $aliasname FOR DATABASE
Failed to delete the specified database alias 'foo.bar': Database alias does not exist.
----

//From 5.26 onwards, the error message also contains the GQLSTATUS code `50N00` and the status description `error: general processing exception - internal error. Internal exception raised { $msgTitle }: Failed to create the specified database alias 'foo.bar'. Database alias does not exist.`

Had the composite database `foo` not existed, the database alias `foo.bar` would have been dropped.

In these cases, it is recommended to avoid parameters and explicitly quote the composite database name and alias name separately to avoid ambiguity.
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ Since locks are used, deadlocks can happen.
A deadlock occurs when two transactions are blocked by each other because they are attempting to concurrently modify a node or a relationship that is locked by the other transaction.
In such a scenario, neither of the transactions will be able to proceed.
When Neo4j detects a deadlock, the transaction is terminated with the transient error message code `Neo.TransientError.Transaction.DeadlockDetected`.
From 5.25 onwards, the error message also contains the GQLSTATUS code `50N05` and the status description `error: general processing exception - deadlock detected. Deadlock detected while trying to acquire locks. See log for more details.`

All locks acquired by the transaction are still held but will be released when the transaction finishes.
Once the locks are released, other transactions that were waiting for locks held by the transaction causing the deadlock can proceed.
Expand Down
Loading