Skip to content

v2.7.0

Choose a tag to compare

@TimelordUK TimelordUK released this 09 Oct 17:49
· 792 commits to master since this release
  1. Node 19 binaries.
  2. better handling of blocked long running queries #264
const timeoutSproc = `CREATE OR ALTER PROCEDURE <name>
AS
BEGIN
\tSET NOCOUNT ON;
\tSET XACT_ABORT ON;
\tWAITFOR DELAY '00:10'; -- 10 minutes
END;
`


    it('pool: sproc with timeout early terminates - check pool', async function handler () {
      const spName = 'timeoutTest'
      const size = 4
      const pool = env.pool(size)
      await pool.promises.open()
      await env.promisedCreate(spName, timeoutSproc)
      try {
        await pool.promises.callProc(spName, {}, { timeoutMs: 2000 })
        throw new Error('expected exception')
      } catch (err) {
        assert(err)
        assert(err.message.includes('Query cancelled'))
        const res = await pool.promises.query('select 1 as n')
        expect(res.first[0].n).equals(1)
      } finally {
        await pool.close()
      }
    })