Giter VIP home page Giter VIP logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
Ha!  There was a big discussion thread about this on a previous mailing list. 
There
was a lot of back and forth about whether the connection should or shouldn't be
closed.  It's a gray area in the JDBC / JTA specs (plus probably a number of 
other
J2EE specs).   Different app servers behave different ways.  I originally though
exactly the same way you are, but after further investigation, it's "more 
common and
accepted" for consumers of a managed to connection to call close().  The 
container or
transaction manager shouldn't actually close the connection, but instead should 
just
"mark" it as no longer in use so that it can be closed at the end of the 
transaction
scope.  While it was still fuzzy as to which way to go, ultimately we decided 
that we
would use iBATIS 2 as the tie breaker -- which means we decided to close the
connection.  

Here's the original thread:

http://www.mail-archive.com/[email protected]/msg16138.html

I think the right thing to do here will be to create another implementation, or
perhaps a config property to not close the connection.  

As for the null check... that's one of those things where I would expect a null
pointer exception.  It's not an acceptable call of that method. 

Cheers,
Clinton

Original comment by [email protected] on 29 May 2010 at 2:17

from mybatis.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024

Original comment by [email protected] on 29 May 2010 at 2:17

  • Added labels: Version-Release3.x, Component-SqlMaps

from mybatis.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
Added closeConnection property to transactionManager.  For example:

{{{
<transactionManager type="MANAGED">
    <property name="closeConnection" value="false"/>
</transactionManager>
}}}

Default is still true (close the connection).

Original comment by [email protected] on 29 May 2010 at 2:54

  • Changed state: Fixed

from mybatis.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024

Original comment by [email protected] on 29 May 2010 at 2:59

  • Added labels: Target-Release3.0.2

from mybatis.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
Can you give a couple of  sample configuration code for "how to make the 
mybatis transaction management in EBJ3.0 contrainer" , thanks very much.


Original comment by [email protected] on 15 Apr 2011 at 4:03

from mybatis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.