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 Karsten Silz <ks...@seldonsystems.com> on 2008/03/18 13:18:43 UTC
IBATIS-496: indefinite wait in Throttle.increment()
Hi!
We have a web application running on Tomcat, using the Commons JDBC
connection pool and iBatis 2.2. Our app uses a single "SqlMapClient"
instance for all our database access. After 7-10 days, the application
doesn't have any database connections anymore. At first we thought we're
running out of MySQL connections, but then we did a Tomcat stack trace dump
("kill -3" to Tomcat in Linux - quite useful) and found tens of threads, all
stuck in the same method:
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:485)
at com.ibatis.common.util.Throttle.increment(Throttle.java:70)
- locked <0x5a26fca8> (a java.lang.Object)
at
com.ibatis.sqlmap.engine.transaction.TransactionManager.begin(TransactionMan
ager.java:54)
at
com.ibatis.sqlmap.engine.transaction.TransactionManager.begin(TransactionMan
ager.java:39)
So all of them are stuck in an infinite wait(). I dug around the bugs, and
this seems to have happened before (e.g., IBATIS-249), but it doesn't seem
to be fixed in 2.3 (to which we switched). So in the meantime, I thought
about modifying the "Throttle.java" constructor to not have an indefinite
wait time; this way, I hope to get an exception rather than a hanging
thread.
Is this a good idea? If so, I had trouble compiling iBatis 2.3 in Eclipse -
there we a lot of external libs missing. This may be a dumb question - but
where can I find a list of libraries there? The "jar-dependies.txt" in
Batis 2.3 just list some optional ones, but then some source classes use
"org.apache.ojb.broker.PersistenceBroker" and
"javax.transaction.UserTransaction" and Hibernate - can I just delete these
if I want to just use iBatis directly?
Regards,
Karsten Silz
Re: IBATIS-496: indefinite wait in Throttle.increment()
Posted by Clinton Begin <cl...@gmail.com>.
There will definitely be more 2.x releases. To date it's just been a matter
of finding the time. I will try to get it out this week.
3.0 may only have a partial upgrade path, as it is the largest change in 6
years. So 2.x will continue to be supported.
Cheers,
Clinton
On Tue, Mar 18, 2008 at 7:33 AM, Karsten Silz <ks...@seldonsystems.com>
wrote:
> Hello!
> Thank you - I'll hunt for connections not closing correctly.
>
> Any new 2.x releases planned? Or do we wait for 3.0 to be the official
> release where this is fixed?
>
> Karsten Silz
>
> ------------------------------
> *From:* Clinton Begin [mailto:clinton.begin@gmail.com]
> *Sent:* Tuesday, March 18, 2008 14:17
> *To:* user-java@ibatis.apache.org
> *Subject:* Re: IBATIS-496: indefinite wait in Throttle.increment()
>
> You're likely not closing off your sessions consistently. Try running
> iBATIS from the SVN trunk. I've removed Throttle from the core, thus you
> should now get a better error (or at least I hope you do!). I'm guessing
> the new error will be from your datasource complaining that you're out of
> connections or something.
>
> Cheers,
> clinton
>
> On Tue, Mar 18, 2008 at 6:18 AM, Karsten Silz <ks...@seldonsystems.com>
> wrote:
>
> > Hi!
> >
> > We have a web application running on Tomcat, using the Commons JDBC
> > connection pool and iBatis 2.2. Our app uses a single "SqlMapClient"
> > instance for all our database access. After 7-10 days, the application
> > doesn't have any database connections anymore. At first we thought we're
> > running out of MySQL connections, but then we did a Tomcat stack trace
> > dump
> > ("kill -3" to Tomcat in Linux - quite useful) and found tens of threads,
> > all
> > stuck in the same method:
> >
> > java.lang.Thread.State: WAITING (on object monitor)
> > at java.lang.Object.wait(Native Method)
> > at java.lang.Object.wait(Object.java:485)
> > at com.ibatis.common.util.Throttle.increment(Throttle.java:70)
> > - locked <0x5a26fca8> (a java.lang.Object)
> > at
> > com.ibatis.sqlmap.engine.transaction.TransactionManager.begin
> > (TransactionMan
> > ager.java:54)
> > at
> > com.ibatis.sqlmap.engine.transaction.TransactionManager.begin
> > (TransactionMan
> > ager.java:39)
> >
> > So all of them are stuck in an infinite wait(). I dug around the bugs,
> > and
> > this seems to have happened before (e.g., IBATIS-249), but it doesn't
> > seem
> > to be fixed in 2.3 (to which we switched). So in the meantime, I
> > thought
> > about modifying the "Throttle.java" constructor to not have an
> > indefinite
> > wait time; this way, I hope to get an exception rather than a hanging
> > thread.
> >
> > Is this a good idea? If so, I had trouble compiling iBatis 2.3 in
> > Eclipse -
> > there we a lot of external libs missing. This may be a dumb question -
> > but
> > where can I find a list of libraries there? The "jar-dependies.txt" in
> > Batis 2.3 just list some optional ones, but then some source classes use
> > "org.apache.ojb.broker.PersistenceBroker" and
> > "javax.transaction.UserTransaction" and Hibernate - can I just delete
> > these
> > if I want to just use iBatis directly?
> >
> > Regards,
> > Karsten Silz
> >
> >
>
RE: IBATIS-496: indefinite wait in Throttle.increment()
Posted by Karsten Silz <ks...@seldonsystems.com>.
Hello!
Thank you - I'll hunt for connections not closing correctly.
Any new 2.x releases planned? Or do we wait for 3.0 to be the official
release where this is fixed?
Karsten Silz
_____
From: Clinton Begin [mailto:clinton.begin@gmail.com]
Sent: Tuesday, March 18, 2008 14:17
To: user-java@ibatis.apache.org
Subject: Re: IBATIS-496: indefinite wait in Throttle.increment()
You're likely not closing off your sessions consistently. Try running
iBATIS from the SVN trunk. I've removed Throttle from the core, thus you
should now get a better error (or at least I hope you do!). I'm guessing
the new error will be from your datasource complaining that you're out of
connections or something.
Cheers,
clinton
On Tue, Mar 18, 2008 at 6:18 AM, Karsten Silz <ks...@seldonsystems.com>
wrote:
Hi!
We have a web application running on Tomcat, using the Commons JDBC
connection pool and iBatis 2.2. Our app uses a single "SqlMapClient"
instance for all our database access. After 7-10 days, the application
doesn't have any database connections anymore. At first we thought we're
running out of MySQL connections, but then we did a Tomcat stack trace dump
("kill -3" to Tomcat in Linux - quite useful) and found tens of threads, all
stuck in the same method:
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:485)
at com.ibatis.common.util.Throttle.increment(Throttle.java:70)
- locked <0x5a26fca8> (a java.lang.Object)
at
com.ibatis.sqlmap.engine.transaction.TransactionManager.begin(TransactionMan
ager.java:54)
at
com.ibatis.sqlmap.engine.transaction.TransactionManager.begin(TransactionMan
ager.java:39)
So all of them are stuck in an infinite wait(). I dug around the bugs, and
this seems to have happened before (e.g., IBATIS-249), but it doesn't seem
to be fixed in 2.3 (to which we switched). So in the meantime, I thought
about modifying the "Throttle.java" constructor to not have an indefinite
wait time; this way, I hope to get an exception rather than a hanging
thread.
Is this a good idea? If so, I had trouble compiling iBatis 2.3 in Eclipse -
there we a lot of external libs missing. This may be a dumb question - but
where can I find a list of libraries there? The "jar-dependies.txt" in
Batis 2.3 just list some optional ones, but then some source classes use
"org.apache.ojb.broker.PersistenceBroker" and
"javax.transaction.UserTransaction" and Hibernate - can I just delete these
if I want to just use iBatis directly?
Regards,
Karsten Silz
Re: IBATIS-496: indefinite wait in Throttle.increment()
Posted by Clinton Begin <cl...@gmail.com>.
You're likely not closing off your sessions consistently. Try running
iBATIS from the SVN trunk. I've removed Throttle from the core, thus you
should now get a better error (or at least I hope you do!). I'm guessing
the new error will be from your datasource complaining that you're out of
connections or something.
Cheers,
clinton
On Tue, Mar 18, 2008 at 6:18 AM, Karsten Silz <ks...@seldonsystems.com>
wrote:
> Hi!
>
> We have a web application running on Tomcat, using the Commons JDBC
> connection pool and iBatis 2.2. Our app uses a single "SqlMapClient"
> instance for all our database access. After 7-10 days, the application
> doesn't have any database connections anymore. At first we thought we're
> running out of MySQL connections, but then we did a Tomcat stack trace
> dump
> ("kill -3" to Tomcat in Linux - quite useful) and found tens of threads,
> all
> stuck in the same method:
>
> java.lang.Thread.State: WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> at java.lang.Object.wait(Object.java:485)
> at com.ibatis.common.util.Throttle.increment(Throttle.java:70)
> - locked <0x5a26fca8> (a java.lang.Object)
> at
> com.ibatis.sqlmap.engine.transaction.TransactionManager.begin
> (TransactionMan
> ager.java:54)
> at
> com.ibatis.sqlmap.engine.transaction.TransactionManager.begin
> (TransactionMan
> ager.java:39)
>
> So all of them are stuck in an infinite wait(). I dug around the bugs,
> and
> this seems to have happened before (e.g., IBATIS-249), but it doesn't seem
> to be fixed in 2.3 (to which we switched). So in the meantime, I thought
> about modifying the "Throttle.java" constructor to not have an indefinite
> wait time; this way, I hope to get an exception rather than a hanging
> thread.
>
> Is this a good idea? If so, I had trouble compiling iBatis 2.3 in Eclipse
> -
> there we a lot of external libs missing. This may be a dumb question -
> but
> where can I find a list of libraries there? The "jar-dependies.txt" in
> Batis 2.3 just list some optional ones, but then some source classes use
> "org.apache.ojb.broker.PersistenceBroker" and
> "javax.transaction.UserTransaction" and Hibernate - can I just delete
> these
> if I want to just use iBatis directly?
>
> Regards,
> Karsten Silz
>
>