ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Padam J Singh <padam.si...@inventum.cc>
Subject Idle in transaction
Date Wed, 01 Nov 2006 08:31:20 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000066">
Hello,<br>
<br>
I have recently upgraded from an application running with iBatis 1.x to
iBatis Version 2.1.7 for Java.<br>
I am not using any transactions in the whole application, and most sql
is single selects/delete/insert to a PostgreSQL 8.0 database.<br>
<br>
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
"&lt;IDLE&gt;" state as reported by <br>
pg_stat_activity view. <br>
However in 2.1.7, the session remains in "&lt;IDLE&gt; in transaction"
state. <br>
This is scary as the transaction is also holding some ExclusiveLocks as
reported in pg_locks.<br>
<br>
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.<br>
<br>
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?<br>
<br>
The SqlMap configuration is as follows:<br>
<font size="-1"><font face="Helvetica, Arial, sans-serif"><br>
<font face="Courier New, Courier, monospace">&lt;?xml version="1.0"
encoding="utf-8"?&gt;<br>
&lt;!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config
2.0//EN"&nbsp; <a class="moz-txt-link-rfc2396E" href="http://www.ibatis.com/dtd/sql-map-config-2.dtd">"http://www.ibatis.com/dtd/sql-map-config-2.dtd"</a>&gt;<br>
&lt;!-- Always ensure to use the correct XML header as above! --&gt;<br>
<br>
&lt;sqlMapConfig&gt;<br>
&lt;properties resource="resources/sqlMapConfig.properties" /&gt;<br>
&lt;settings cacheModelsEnabled="true" enhancementEnabled="true"
maxSessions="64"&nbsp; maxTransactions="8"<br>
&nbsp;&nbsp;&nbsp; maxRequests="128" useStatementNamespaces="false" /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;transactionManager type="JDBC" commitRequired="true"&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;dataSource type="DBCP"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="JDBC.Driver" value="${driver}" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="JDBC.ConnectionURL" value="${url}"
/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="JDBC.Username" value="${username}"
/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="JDBC.Password" value="${password}"
/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="JDBC.DefaultAutoCommit" value="true"
/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="Pool.MaximumActiveConnections"
value="10" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="Pool.MaximumIdleConnections"
value="5" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="Pool.MaximumWait" value="60000" /&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/dataSource&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/transactionManager&gt;<br>
&lt;!-- Identify all SQL Map XML files to be loaded by this SQL map.
Notice the paths<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; are relative to the classpath. For now,
we only have one? --&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;sqlMap resource="sql/Common.xml"
/&gt;<br>
&lt;/sqlMapConfig&gt;<br>
<br>
</font></font></font>Thanks<br>
Padam J Singh.<br>
</body>
</html>

Mime
View raw message