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: Ibatis throttle - possible deadlock (ibatis 2.2, 2.3)
Date Fri, 11 Jan 2008 21:39:08 GMT
It's most likely that somewhere in your code you're not properly ending a
transaction or closing a session.... Every single SqlMapClient usage should
be wrapped with something like this (unless you're not using a transaction
at all):

try {
  // start
  // work
  // commit
} finally {
  // end

Incidentally, if you want to grab the latest source from the trunk and build
it (simple to do), I've completely removed all of the pooled scopes.  While
this likely won't solve your problem, the stack trace will likely point you
to your datasouce and it will appear instead as though you're running out of
connections (unless you're using our simpledatasource, in which case the
connections will be forcefully reclaimed and you may never know about the

I'd do a thorough check of all  SqlMapClient usages and make sure they're in
try/finally blocks and that there is exactly the same number of starts as
there are ends... (global text search can usually do this fairly easily).


-----Original Message-----
From: Nikolas Kyriazopoulos Panagiotopoulos [mailto:nikolaskp@gmail.com] 
Sent: January-11-08 8:41 AM
To: user-java@ibatis.apache.org
Subject: Re: Ibatis throttle - possible deadlock (ibatis 2.2, 2.3)

[I resend this message because I hadn't confirmed the subscription to
the list before sending. Sorry for all those that might receive it

I would like to bring this: https://issues.apache.org/jira/browse/IBATIS-249
into attention.
It seems that either an old problem is resurging (not really solved),
or that we have some configuration problems, so I would  appreciate
your help.

Every hour (approximately), suddenly, without a gradual increase in
thread count etc, a deadlock(?) suddenly rises the charge in our web
application and within seconds, the application is dead.
We tend to see threads like the following through jconsole when this

Name: TP-Processor431
State: WAITING on java.lang.Object@253e7f
Total blocked: 4 388 Total waited: 248

Stack trace:
java.lang.Object.wait(Native Method)

The database configuration is like this in our Spring 2.5.1
configuration files, for approximately 1000 connected users:

   <bean id="dataSource"
       <property name="maxActive" value="100"/>
       <property name="maxIdle" value="30"/>
       <property name="maxWait" value="10000"/>

View raw message