diff --git a/src/fiber_orm/pool.nim b/src/fiber_orm/pool.nim index f5252f4..d7c06f7 100644 --- a/src/fiber_orm/pool.nim +++ b/src/fiber_orm/pool.nim @@ -93,5 +93,5 @@ proc release*(pool: DbConnPool, connId: int): void = template withConn*(pool: DbConnPool, stmt: untyped): untyped = let (connId, conn {.inject.}) = take(pool) - stmt - release(pool, connId) + try: stmt + finally: release(pool, connId)