Skip to content

Docs: CALL IN TRANSACTIONS refused in explicit transactions (#11588); SQL keyset pagination on a common equality (#11700) #541

Open

Description

@robfrank

Two fixes merged for 26.12.1 change behavior the docs describe.

1. CALL { ... } IN TRANSACTIONS is refused inside an explicit transaction (ArcadeData/arcadedb#11588, PR ArcadeData/arcadedb#11664)

reference/cypher/cypher-clauses.adoc (around line 1561) says:

NOTE: IN TRANSACTIONS should not be used inside an already open explicit transaction.

It is now refused with Neo4j's error: "A query with 'CALL { ... } IN TRANSACTIONS' can only be executed in an implicit transaction, but tried to execute in an explicit transaction". Update the note to say:

  • it fails inside an HTTP /begin session, a Bolt BEGIN, an embedded database.begin() / database.transaction(), and database.async().command(...);
  • it runs in batches with no transaction (embedded database.command(...)) and in the implicit transaction the HTTP, gRPC, MCP and Postgres servers open around a single request.

The Java API page for transactions could also mention this for embedded users.

2. SQL keyset pagination on a common indexed equality (ArcadeData/arcadedb#11700, PR ArcadeData/arcadedb#11706)

The keyset pagination docs (cypher-clauses.adoc [[cypher-keyset-pagination]], referenced from concepts/indexes.adoc) cover Cypher only. For SQL, a page like

SELECT FROM Chunk WHERE graph_name = :g AND external_id > :after ORDER BY external_id LIMIT 500

with separate indexes on graph_name and external_id is now planned by comparing two plans: fetch every row of the partition and sort it, or walk the external_id index in order and stop once the page is full. The walk is chosen when it reads less than half as many entries. Worth documenting:

  • a composite index on (graph_name, external_id) is still the fastest answer;
  • the walk needs a literal or parameter LIMIT, a single ORDER BY on a plain property, no OR, GROUP BY, DISTINCT or aggregates;
  • for the first page, which has no bound on the sort key, the walk needs a sort key no returned record can miss (NOTNULL and MANDATORY, an IS NOT NULL condition, or an index that holds nulls);
  • statements that take this decision are re-planned on each execution, not cached.

Release notes for both are in docs/26-12-1-notes.md of the main repo.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions