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

Posted by draezal on Stack Overflow See other posts from Stack Overflow or by draezal
Published on 2011-01-14T02:47:25Z Indexed on 2011/01/14 2:53 UTC
Read the original article Hit count: 274

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 :)

© Stack Overflow or respective owner

Related posts about database

Related posts about jdbc