Hi,

Please see the settings documented on
https://commons.apache.org/proper/commons-dbcp/configuration.html:
enableAutoCommitOnReturn, rollbackOnReturn.

Gary

On Sat, Oct 2, 2021, 16:04 Francesco De Angelis <[email protected]>
wrote:

> Hello,
> this is my first message, so I hope I will have the opportunity to get some
> answers to my question.
>
> I have an application handling a simple pool of connections through a
> BasicDataSource object (DBCP 2.8.0). The associated pool is used to load a
> database concurrently through several connections.
> Due to some design constraints, at the end of the loading either all the
> connections are subject to commits or rollbacks, i.e. either the overall
> loading process succeeds or fails.
> My question is the following: is there a way to enforce such behaviour
> through auto-commit=false, or does the library calls rollback() or close()
> internally when the connection is released to make it available again from
> the pool? In other terms, what happens if neither rollback() nor commit()
> is invoked on a connection that released? Is it subject to any default
> action?
>
> Thanks a lot for your help.
>
> Best regards,
> Francesco De Angelis
>

Reply via email to