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: SqlSession question
Date Mon, 08 Mar 2010 19:33:28 GMT
The only rationale there is to allow for you to commit more than once within
a session scope.  In previous versions of iBATIS this was possible, but was
messy because Session, Transaction and Batches were all managed separately.
 Because we've now merged all three into this one concept, we didn't want to
lose the ability to commit multiple times within a session.

Of course, I highly recommend committing only once and using broadly scoped
transactions as possible.  But that recommendation has little to do with
iBATIS specifically.  :-)

Cheers,
Clinton

On Mon, Mar 8, 2010 at 9:40 AM, J S <sharpfeline@yahoo.ca> wrote:

> Please exercise some patience if what I am about to ask sounds dumb.  I'm
> still new to Ibatis; so far it has been a very pleasant experience.
>
> I get the impression that the SqlSession class bundles the functionality of
> both, transactions and a persistence context.  This mixture is still unclear
> to me, and I would like to understand more about the semantics behind the
> SqlSession class.  More specifically, I'd like to understand the
> relation/side effects between transactions, jdbc connections and the
> following methods:
>
> SqlSession.clearCache()
> SqlSession.commit()
> SqlSession.rollback()
> SqlSession.close()
>
> Through some brute force experimentation/debugging, I can see that commit()
> and rollback() hold on to a borrowed connection, while close() returns the
> connection to the pool.  What's the rationale behind this logic?
>
> Feel free to point me to any docs that may answer some of these.
>
> Thanks.
>
> J
>
>
> ------------------------------
> Looking for the perfect gift?* Give the gift of Flickr!*<http://www.flickr.com/gift/>

Mime
View raw message