Can I create support multiple database transactions on a single connection?
- by draezal
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 transaction due to the overhead associated with this.
Looking at some similar questions the suggestion appeared to be to create a pool of database connections and then block waiting for one to become available. This is a workable, but not desirable solution.
Background Info (if this is relevant to the answer). My application will create a new thread when some request comes in. This request will require a database transaction. Then some not insignificant time later this transaction will be committed.
Any advice appreciated :)