Can I create support multiple database transactions on a single connection?

前端 未结 2 364
庸人自扰
庸人自扰 2021-01-07 06:51

I have created a HyperSQL Database. I was just wondering whether I could run multiple transactions on a single connection. I didn\'t want to spawn a new connection for each

相关标签:
2条回答
  • 2021-01-07 07:20

    Absolutely no. every "transaction" must have begin, complete or rollback. Of course you can separate a single transaction to some parts on a single line of original transaction. no more no less.

    0 讨论(0)
  • 2021-01-07 07:29

    You should be able to run multiple transactions over a single connection they will just have to be run one at a time so you'll have to queue or stack them and block as the transaction happens. You generally will not be able to run queries in parallel over a single connection.

    0 讨论(0)
提交回复
热议问题