ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clinton Begin" <clinton.be...@gmail.com>
Subject Re: iBATIS & DB connections
Date Tue, 07 Aug 2007 22:35:17 GMT
>> Does iBATIS get a new Connection for each query and then close it again
afterwards?

This totally depends on the connection pool you're using.  Since you're
using Spring, it's totally up to whichever connection pool spring is using.

>> Is it different for select vs insert or update?

Normally no, save for your next question....

>> Does it depend on whether a transaction is open?

Yes.  If a transaction is open, it will reuse the same connection (within a
transaction scope) for all statements (be it insert or select) within that
scope.

If a transaction is not open, every single statement you call (be it insert
or select) will request a separate connection (which may in fact be the same
depending on the pool).

Cheers,
Clinton

On 8/7/07, Broderick, Andrew (GE Indust, ES Rail, consultant) <
andrew.broderick@ge.com> wrote:
>
> Hi,
>
> I am using iBATIS 2.3 with Spring 2 and Oracle 10g. I have a few
> questions:
>
> -Does iBATIS get a new Connection for each query and then close it again
> afterwards?
> -Is it different for select vs insert or update?
> -Does it depend on whether a transaction is open?
>
> Thanks,
>
> Andrew B
>

Mime
View raw message