Hello,

I have recently upgraded from an application running with iBatis 1.x to iBatis Version 2.1.7 for Java.
I am not using any transactions in the whole application, and most sql is single selects/delete/insert to a PostgreSQL 8.0 database.

As soon as I fire up the application, it executes a single select statement. In earlier version of iBatis, the connection would be in a "<IDLE>" state as reported by
pg_stat_activity view.
However in 2.1.7, the session remains in "<IDLE> in transaction" state.
This is scary as the transaction is also holding some ExclusiveLocks as reported in pg_locks.

Please note, I do not have any startTransaction anywhere, so the question of not ending a transaction by forgetting to call endTransaction does not arise.

Anyone know if this is a bug? I know that idle in transaction generally means that something started a transaction but did not end it. Since I only have select query why does the connection show up as idle in transaction?

The SqlMap configuration is as follows:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"  "http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<!-- Always ensure to use the correct XML header as above! -->

<sqlMapConfig>
<properties resource="resources/sqlMapConfig.properties" />
<settings cacheModelsEnabled="true" enhancementEnabled="true" maxSessions="64"  maxTransactions="8"
    maxRequests="128" useStatementNamespaces="false" />
    <transactionManager type="JDBC" commitRequired="true">
    <dataSource type="DBCP">
                <property name="JDBC.Driver" value="${driver}" />
                <property name="JDBC.ConnectionURL" value="${url}" />
                <property name="JDBC.Username" value="${username}" />
                <property name="JDBC.Password" value="${password}" />
                <property name="JDBC.DefaultAutoCommit" value="true" />
                <property name="Pool.MaximumActiveConnections" value="10" />
                <property name="Pool.MaximumIdleConnections" value="5" />
                <property name="Pool.MaximumWait" value="60000" />
        </dataSource>
        </transactionManager>
<!-- Identify all SQL Map XML files to be loaded by this SQL map. Notice the paths
      are relative to the classpath. For now, we only have one? -->
        <sqlMap resource="sql/Common.xml" />
</sqlMapConfig>

Thanks
Padam J Singh.

Reply via email to