neo4j / neo4j-go-driver

Neo4j Bolt Driver for Go
Apache License 2.0
482 stars 68 forks source link

Return error if operation is attempted on a closed session #570

Closed StephenCathcart closed 4 months ago

StephenCathcart commented 4 months ago

A session is still usable even after closing it explicitly:

session := driver.NewSession(ctx, sessionConfig)
session.Close()
// These all still work
session.Run(...)
session.BeginTransaction(...)
session.ExecuteRead(...)
session.ExecuteWrite(...)

We now return a new UsageError when an operation is attempted on a closed session.

Fixes issue: https://github.com/neo4j/neo4j-go-driver/issues/569 raised by @oleriajm

StephenCathcart commented 4 months ago

Session is still usable even after explicitly closing it