connection is not returned into pool leading ultimately to pool exhaustion. The correct way is to call db.NamedExec instead. The problem is API is not preventing one from calling inappropriate method (NamedQuery) with update/delete. This leads to very tricky and hard to troubleshoot errors. Could this be documented in method comments and ideally somehow prevented in runtime (e.g. trowing fatal error when calling NamedQuery with update/delete)?
when calling db.NamedQuery with update/delete statement, e.g.:
connection is not returned into pool leading ultimately to pool exhaustion. The correct way is to call db.NamedExec instead. The problem is API is not preventing one from calling inappropriate method (NamedQuery) with update/delete. This leads to very tricky and hard to troubleshoot errors. Could this be documented in method comments and ideally somehow prevented in runtime (e.g. trowing fatal error when calling NamedQuery with update/delete)?