cranlike (version 1.0.2)

with_db_lock: Perform a DB query, with locking

Description

This creates a transaction, and an exclusive lock. It always creates a new DB connection, and closes it on exit.

Usage

with_db_lock(db_file, expr)

Arguments

db_file

File of the DB.

expr

Expression to evaluate, it can refer to the connection handle as db.