Node.js + MySQL - handling transactions

前端 未结 5 1375
慢半拍i
慢半拍i 2021-02-07 22:27

I am building an app on node.js using express, and node-mysql driver. There is a couple of cases in my app when I need to make a series of database inserts/updates. I want them

5条回答
  •  攒了一身酷
    2021-02-07 22:54

    Just an idea: on postresql you can start a transaction and set an ID to it. So then, you could be reusing the same connection around, because in case you need to commit or rollback, you are going to refer to your transaction by id, right?

提交回复
热议问题