Skip to content

Commit

Permalink
Add GQLSTATUS code to Neo. code (neo4j#2008) (neo4j#2032)
Browse files Browse the repository at this point in the history
Cherry-picked from neo4j#2008
  • Loading branch information
renetapopova authored Dec 24, 2024
1 parent 2b90f41 commit fd87ea7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
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

0 comments on commit fd87ea7

Please sign in to comment.