Closed sj82516 closed 6 years ago
It should work how you're trying to use it, same as in #34. Without seeing the rest of your code I can't tell you why it's not working.
Thanks for your rapid reply!
When I replace conn. beginTransaction()
to conn.query('START TRANSACTION')
, it works properly.
I can't find out where goes wrong.
Just found something. You'll need to get a connection from the pool using .getConnection()
before doing the transaction using that connection. Have a look in the readme for an example.
It works. Thanks a lot. please close this issue
I would like to apply transaction inside my sql query.
However, it throw error "ctx.conn.rollback is not a function" I use
ctx.conn.query(...)
in many place and works fine. How can I use transaction methods mysql js provided?Thanks
Or should I directly call connection.query('START TRANSACTION') ..... connection.query('COMMIT')