One possibility is that an object is being removed from the pool objects
collection while the pool is being garbage collected. The ObjectPool
class removeObject() method synchronizes on a lock, but that does not
preclude a concurrent attempt to iterate on the collection, which could
raise the ConcurrentModificationException.

Although the GC does not directly iterate on the objects collection, it
does make a values() call on the original, which in turn will iterate on
the objects collection, thereby inducing the conflict. The way to test
this hypothesis is to wrap the runGCandShrink() body in the block:

  synchronized(resizeLock) {
  }

I don't know the performance implications, but that might be advisable
in any case.

Dan, if this is a reasonable guess and you need a patch to test, let me
know.

Fred Loney
Spirited Software, Inc.
www.spiritedsw.com

----- Original Message -----
From: "Daniel Ferrante" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 25, 2001 3:00 PM
Subject: RE: [JBoss-user] JBoss and MySql Problems


I have narrowed down part of the problem to the following exception
being thrown
java.util.ConcurrentModificationException
[dbPool]   at java.util.HashMap$HashIterator.next(HashMap.java:736)
[dbPool]   at
java.util.AbstractCollection.addAll(AbstractCollection.java:317)
[dbPool]   at java.util.HashSet.<init>(HashSet.java:86)
[dbPool]   at
org.opentools.minerva.pool.ObjectPool.runGCandShrink(ObjectPool.java:749
)
[dbPool]   at
org.opentools.minerva.pool.PoolGCThread.runGC(PoolGCThread.java:66)
[dbPool]   at
org.opentools.minerva.pool.PoolGCThread.run(PoolGCThread.java:37)

Can anyone give me a hint as to where to begin debugging this.  The app
is under moderate load.
Dan

-----Original Message-----
From: Fred Loney [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 25, 2001 1:50 PM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] JBoss and MySql Problems


I agree that low pool size is useful for development; I set it to 2 for
that reason. Perhaps a simpler solution than intelligent self-tuning
algorithms is documentation: a prescriptive appendix that complements
the excellent descriptive documentation. E.g. a section of the HOWTO
chapter:

How to Tune JBoss
-------------------
For development ...
For testing ...
For production ...

I don't know enough about jboss to do this myself, but I would be
willing to collect the insights of others and write something up if that
would be of value.

Fred Loney
Spirited Software, Inc.
www.spiritedsw.com

----- Original Message -----
From: "David Jencks" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 25, 2001 5:20 AM
Subject: Re: [JBoss-user] JBoss and MySql Problems


> On 2001.09.24 23:04:00 -0400 marc fleury wrote:
> > |Let me say it again, louder: PUT A REASONABLE MAXSIZE IN YOUR POOL!
> >
> > can't we increase the max value in the default jcml?
> >
> > marcf
>
> Sure, but why? I'd rather eliminate the possibility of unlimited size.
I
> don't know hsql's max capabilities, but possibly 10 connections is
about
> all you'd want for a db running in the same vm as the server... with a
> bigger db, you can set for more.
>
> Right now, I kind of like a small default: many people are finding
ways to
> break connections/pooling, and I think it's good to make this show up
> soon.. so their app won't work, quickly, under very mild stress.  Once
they
> fix it, they can adjust the pooling to match their load.  What would
be
> great would be an estimator.... for x concurrent clients in a typical
web
> app w/ y db requests/ web page try z max connections...sigh, I fear
that's
> a long way off... maybe we could collect time/db call and average
blocking
> wait times to help... so much to do.  Does something like this relate
in
> any way to the stuff Andy was working on?
>
> david jencks
> >
> > |If your app doesn't work well with a fairly small value
proportional to
> > |the
> > |load on your app, there is something wrong that you need to fix.
> > |
> > |david jencks
> > |
> > |> Thanks,
> > |> Dan
> > |>
> > |> -----Original Message-----
> > |> From: David Jencks [mailto:[EMAIL PROTECTED]]
> > |> Sent: Monday, September 24, 2001 6:37 PM
> > |> To: [EMAIL PROTECTED]
> > |> Subject: Re: [JBoss-user] JBoss and MySql Problems
> > |>
> > |>
> > |> Well, setting maxsize to 0 means no limit.  Some db/driver
> > |combinations
> > |> have a limit on the number of concurrent connections, at least
from
> > |one
> > |> ip
> > |> address.  Try setting maxsize rather small -- say 5 or 10 -- and
> > |verify
> > |> you
> > |> really are releasing connections.
> > |>
> > |> david jencks
> > |>
> > |> On 2001.09.24 18:00:22 -0400 Daniel Ferrante wrote:
> > |> > Hi -
> > |> > Below is my setup for a connection pool with mysql.  I am using
CMP
> > |> with
> > |> > JBoss and MySQL
> > |> >
> > |> > <mbean code="org.jboss.jdbc.XADataSourceLoader"
> > |> > name="DefaultDomain:service=XADataSource,name=dbPool">
> > |> >     <attribute name="PoolName">dbPool</attribute>
> > |> >     <attribute
> > |> >
> > |>
> >
|name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSour
c
> > |> > eImpl</attribute>
> > |> >     <attribute name="URL">jdbc:mysql:url</attribute>
> > |> >     <attribute name="JDBCUser">user</attribute>
> > |> >     <attribute name="Blocking">true</attribute>
> > |> >     <attribute name="MaxSize">0</attribute>
> > |> >     <attribute name="Password">pass</attribute>
> > |> >     <attribute name="LoggingEnabled">true</attribute>
> > |> >   </mbean>
> > |> >
> > |> > I am trying to debug why my application constantly dies (or
hangs)
> > |> after
> > |> > 100 connections are created.  I have made sure that I am
closing all
> > |> the
> > |> > connections to the database in my code (that is anywhere I make
a
> > |> direct
> > |> > connection to the database not using the entity beans).
> > |> >
> > |> > I understand since Blocking is set to true that it waits for a
new
> > |> > connection.  Is this a problem with CMP, mySQL, or do you see
> > |anything
> > |> > in the XADataSourceLoader.
> > |> >
> > |> > Thanks
> > |> > Dan
> > |> >
> > |> > _______________________________________________
> > |> > JBoss-user mailing list
> > |> > [EMAIL PROTECTED]
> > |> > https://lists.sourceforge.net/lists/listinfo/jboss-user
> > |> >
> > |> >
> > |>
> > |> _______________________________________________
> > |> JBoss-user mailing list
> > |> [EMAIL PROTECTED]
> > |> https://lists.sourceforge.net/lists/listinfo/jboss-user
> > |>
> > |>
> > |> _______________________________________________
> > |> JBoss-user mailing list
> > |> [EMAIL PROTECTED]
> > |> https://lists.sourceforge.net/lists/listinfo/jboss-user
> > |>
> > |>
> > |
> > |_______________________________________________
> > |JBoss-user mailing list
> > |[EMAIL PROTECTED]
> > |https://lists.sourceforge.net/lists/listinfo/jboss-user
> > |
> > |
> > |_______________________________________________
> > |JBoss-user mailing list
> > |[EMAIL PROTECTED]
> > |https://lists.sourceforge.net/lists/listinfo/jboss-user
> >
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
> >
> >
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to