You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Fernando Rengifo <fr...@gmail.com> on 2009/11/19 20:48:33 UTC

iBATIS 2.3.4 issues closing connections

Hi all,

Thank you for your time to read this question.
I really (really) appreciate your help on this.

I have developed an application using iBATIS (what a great framework!).
The project started on Feb 2009, and since Oct 2009 is under my client's
server.

We use JNDI to a DB2 iSeries Toolbox DataSource configured under Websphere
6.1 using j400.jar driver.

Since yesterday, they have been noticing this problem with some tables at
DB2 (iSeries) server.
"....... *FILE in use".

They have been making me questions about this issue because they think
iBATIS does not close connections after any transaction.
I have told them about iBATIS documentation, where it says
startTransaction() and endTransaction() are called automatically if we
don't.

What I can tell you, is that I only use sqlMapper.update(), insert(),
queryForObject(), queryForList() for simple queries.

For batch queries, I use the startTransaction(), startBatch(),
executeBatch(), commitTransaction(), endTransaction():

Am I missing somthing ? Is this related to iBATIS?

Thank you very much.

  -Fernando Rengifo.

Re: iBATIS 2.3.4 issues closing connections

Posted by Jeff Hibbs <jh...@bop.gov>.
Hi Fernando - 
 
I started having problems when we moved from Sun 1 App Server to
Glassfish - apparently the Glassfish connection pool operates a little
differently then the Sun 1 connection pool and doesn't properly close
connections/threads (at least with DB2/iBATIS).  It appears that DB2 
sees selects as a transaction and the commitRequired parm does some sort
of commit, even on selects.  The only change I had to make was the
autocommit parm
 
No, I didn't have to start/commit/end transactions for every SQL
statement.  I only do that when I truly need a transaction for
updates/deletes.
 
Hope this helps....Jeff


>>> Fernando Rengifo <fr...@gmail.com> 11/19/2009 3:33 PM >>>
Hi Jeff, 

Thank you very much for your time answering this question.

Mine looks as follows:

<transactionManager type="EXTERNAL">
<property name="SetAutoCommitAllowed" value="false"/>
<dataSource type="JNDI">
<property name="DataSource" value="java:comp/env/jdbc/myapp"/>
</dataSource>
</transactionManager>

Any ideas?

So, if I enable the commitRequired="true" do I have to use
startTransaction(), commitTransaction() and endTransaction() at any
single SQL?

Thank you again.

-Fernando Rengifo.


On Thu, Nov 19, 2009 at 3:02 PM, Jeff Hibbs <jh...@bop.gov> wrote:


Fernando - 
I'm no expert, but I had a similar problem using DB2. When we moved
from Sun App servers to Glassfish I started having "open Threads"...Not
sure if this is the same as what you're experiencing, but all I had to
do was change my sqlMapConfig file to add the 
commitRequired="true" parm....so it looks like this:
<transactionManager type="JDBC" commitRequired="true">
<dataSource type="JNDI">
<property name="DataSource"
value="java:comp/env/@isds.datasource.name@"/>
</dataSource>
</transactionManager>
I hope this helps...Jeff Hibbs

>>> Fernando Rengifo <fr...@gmail.com> 11/19/2009 2:48 PM >>>

Hi all,


Thank you for your time to read this question.
I really (really) appreciate your help on this.

I have developed an application using iBATIS (what a great
framework!).
The project started on Feb 2009, and since Oct 2009 is under my
client's server.

We use JNDI to a DB2 iSeries Toolbox DataSource configured under
Websphere 6.1 using j400.jar driver.

Since yesterday, they have been noticing this problem with some tables
at DB2 (iSeries) server.
"....... *FILE in use".

They have been making me questions about this issue because they think
iBATIS does not close connections after any transaction.
I have told them about iBATIS documentation, where it says
startTransaction() and endTransaction() are called automatically if we
don't.

What I can tell you, is that I only use sqlMapper.update(), insert(),
queryForObject(), queryForList() for simple queries.

For batch queries, I use the startTransaction(), startBatch(),
executeBatch(), commitTransaction(), endTransaction():

Am I missing somthing ? Is this related to iBATIS?

Thank you very much.

-Fernando Rengifo.




This message is intended for official use and may
contain SENSITIVE information. If this message
contains SENSITIVE information, it should be
properly delivered, labeled, stored, and disposed
of according to policy.”


Re: iBATIS 2.3.4 issues closing connections

Posted by Fernando Rengifo <fr...@gmail.com>.
Hi Jeff,

Thank you very much for your time answering this question.

Mine looks as follows:

<transactionManager type="EXTERNAL">
  <property name="SetAutoCommitAllowed" value="false"/>
  <dataSource type="JNDI">
    <property name="DataSource" value="java:comp/env/jdbc/myapp"/>
  </dataSource>
</transactionManager>

Any ideas?

So, if I enable the commitRequired="true" do I have to use
startTransaction(), commitTransaction() and endTransaction() at any single
SQL?

Thank you again.

  -Fernando Rengifo.


On Thu, Nov 19, 2009 at 3:02 PM, Jeff Hibbs <jh...@bop.gov> wrote:

>  Fernando -
>
> I'm no expert, but I had a similar problem using DB2.  When we moved from
> Sun App servers to Glassfish I started having "open Threads"...Not sure if
> this is the same as what you're experiencing, but all I had to do was change
> my sqlMapConfig file to add the
>
> commitRequired="true" parm....so it looks like this:
>
>  <transactionManager type="JDBC" commitRequired="true">
>         <dataSource type="JNDI">
>             <property name="DataSource" value="java:comp/env/@
> isds.datasource.name@"/>
>         </dataSource>
>     </transactionManager>
>
> I hope this helps...Jeff Hibbs
>
> >>> Fernando Rengifo <fr...@gmail.com> 11/19/2009 2:48 PM >>>
> Hi all,
>
> Thank you for your time to read this question.
> I really (really) appreciate your help on this.
>
> I have developed an application using iBATIS (what a great framework!).
> The project started on Feb 2009, and since Oct 2009 is under my client's
> server.
>
> We use JNDI to a DB2 iSeries Toolbox DataSource configured under Websphere
> 6.1 using j400.jar driver.
>
> Since yesterday, they have been noticing this problem with some tables at
> DB2 (iSeries) server.
> "....... *FILE in use".
>
> They have been making me questions about this issue because they think
> iBATIS does not close connections after any transaction.
> I have told them about iBATIS documentation, where it says
> startTransaction() and endTransaction() are called automatically if we
> don't.
>
> What I can tell you, is that I only use sqlMapper.update(), insert(),
> queryForObject(), queryForList() for simple queries.
>
> For batch queries, I use the startTransaction(), startBatch(),
> executeBatch(), commitTransaction(), endTransaction():
>
> Am I missing somthing ? Is this related to iBATIS?
>
> Thank you very much.
>
> -Fernando Rengifo.
>
>

Re: iBATIS 2.3.4 issues closing connections

Posted by Jeff Hibbs <jh...@bop.gov>.
Fernando - 
 
I'm no expert, but I had a similar problem using DB2.  When we moved
from Sun App servers to Glassfish I started having "open Threads"...Not
sure if this is the same as what you're experiencing, but all I had to
do was change my sqlMapConfig file to add the 
 
commitRequired="true" parm....so it looks like this:
 
 <transactionManager type="JDBC" commitRequired="true">
        <dataSource type="JNDI">
            <property name="DataSource"
value="java:comp/env/@isds.datasource.name@"/>
        </dataSource>
    </transactionManager>
 
I hope this helps...Jeff Hibbs

>>> Fernando Rengifo <fr...@gmail.com> 11/19/2009 2:48 PM >>>

Hi all,


Thank you for your time to read this question.
I really (really) appreciate your help on this.

I have developed an application using iBATIS (what a great
framework!).
The project started on Feb 2009, and since Oct 2009 is under my
client's server.

We use JNDI to a DB2 iSeries Toolbox DataSource configured under
Websphere 6.1 using j400.jar driver.

Since yesterday, they have been noticing this problem with some tables
at DB2 (iSeries) server.
"....... *FILE in use".

They have been making me questions about this issue because they think
iBATIS does not close connections after any transaction.
I have told them about iBATIS documentation, where it says
startTransaction() and endTransaction() are called automatically if we
don't.

What I can tell you, is that I only use sqlMapper.update(), insert(),
queryForObject(), queryForList() for simple queries.

For batch queries, I use the startTransaction(), startBatch(),
executeBatch(), commitTransaction(), endTransaction():

Am I missing somthing ? Is this related to iBATIS?

Thank you very much.

-Fernando Rengifo.

This message is intended for official use and may
contain SENSITIVE information. If this message
contains SENSITIVE information, it should be
properly delivered, labeled, stored, and disposed
of according to policy.”