db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject Re: cvs organisation: HEAD as active development branch
Date Thu, 10 Feb 2005 12:47:12 GMT





Hi Thomas

I will commit the patch in the next days. Remind me if I forget it.

       Thomas

Thomas Vandahl <thomas.vandahl@tewisoft.de> schrieb am 09.02.2005 19:31:37:

> Hi Thomas,
>
> > Considering the amount of changes, I would propose to call the next
release
> > 3.2, and therefore abandon the TORQUE_3_1_BRANCH.
> > If someone feels it necessary to do further commits to the
> > TORQUE_3_1_BRANCH, PLEASE also commit the changes to HEAD, if it makes
any
> > sense.
>
> Would you please introduce the attached patch into LargeSelect.java. It
> was posted here in the list some time ago by someone else and deals with
> the infamous ConcurrentModificationException in the thread code. I
> thought the patch had made it already into the CVS but I found it
> missing in the new HEAD.
>
> (BTW: Your join patches work quite well in my application. The tests
> were all successful!)
>
> Bye, Thomas.
> --- LargeSelect.java.orig   Wed Feb  9 19:22:04 2005
> +++ LargeSelect.java   Wed Feb  9 19:28:48 2005
> @@ -624,7 +624,13 @@
>                      + "fromIndex + Math.min(size, results.size() -
> fromIndex) ("
>                      + toIndex + ")");
>          }
> -        List returnResults = results.subList(fromIndex, toIndex);
> +
> +        List returnResults;
> +
> +        synchronized (results)
> +        {
> +            returnResults = new ArrayList(results.
> subList(fromIndex, toIndex));
> +        }
>
>          if (null != returnBuilderClass)
>          {
> @@ -705,9 +711,12 @@
>                  List tempResults
>                          = BasePeer.getSelectResults(qds, size, false);
>
> -                for (int i = 0, n = tempResults.size(); i < n; i++)
> +                synchronized (results)
>                  {
> -                    results.add(tempResults.get(i));
> +                    for (int i = 0, n = tempResults.size(); i < n; i++)
> +                    {
> +                        results.add(tempResults.get(i));
> +                    }
>                  }
>
>                  currentlyFilledTo += tempResults.size();
> @@ -717,7 +726,10 @@
>                  // on the last page but we must now get rid of it.
>                  if (results.size() == memoryLimit + 1)
>                  {
> -                    results.remove(currentlyFilledTo--);
> +                    synchronized (results)
> +                    {
> +                        results.remove(currentlyFilledTo--);
> +                    }
>                      perhapsLastPage = false;
>                  }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message