Class LockableConnection

  • All Implemented Interfaces:
    AutoCloseable, Connection, Wrapper

    public final class LockableConnection
    extends Object
    implements Connection
    This JDBC connection decorator writes a (:__LiquigraphLock) Neo4j node in order to prevent concurrent executions.

    Closing this connection will delete the created "Lock" node.

    A shutdown hook is executed to remove the lock node if and only if the connection has not been properly closed.

    Please note that any Connection passed to this decorator will be set to auto-commit: false`. The auto-commit property is restored on close. The latter is done in order to minimize side effects when connections are recycled by a connection pool, for instance.