qasta / gettext-commons

Automatically exported from code.google.com/p/gettext-commons
GNU Lesser General Public License v2.1
0 stars 0 forks source link

I18nCache concurrent modification exception #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
With gettext-commons 0.9.1.

I think the cache is broken with multiple concurrent clients.

 2008-03-10 12:11:52,512 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/].[jsp]]
El Servlet.service() para servlet jsp lanzó una excepción
java.util.ConcurrentModificationException
        at
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:449)
        at java.util.AbstractList$Itr.next(AbstractList.java:420)
        at org.xnap.commons.i18n.I18nCache.get(I18nCache.java:57)
        at org.xnap.commons.i18n.I18nFactory.getI18n(I18nFactory.java:231)
        at org.xnap.commons.i18n.I18nFactory.getI18n(I18nFactory.java:180)
        at org.xnap.commons.i18n.I18nFactory.getI18n(I18nFactory.java:127)
        at org.xnap.commons.i18n.I18nFactory.getI18n(I18nFactory.java:116)

Original issue reported on code.google.com by david.calavera@gmail.com on 10 Mar 2008 at 11:32

GoogleCodeExporter commented 9 years ago
Thank you for reporting this. We will look into it.

Original comment by berge...@gmail.com on 10 Mar 2008 at 2:21

GoogleCodeExporter commented 9 years ago
Steffen, from looking at the code we didn't design it to be thread safe. Any 
reason
not to do it that I forget about? Otherwise I'd also do it for I18nFactory.

Original comment by berge...@gmail.com on 10 Mar 2008 at 2:43

GoogleCodeExporter commented 9 years ago
That looks like a bug. It should be safe to access the code from multiple 
threads 
concurrently.

Original comment by steffen....@googlemail.com on 11 Mar 2008 at 7:20

GoogleCodeExporter commented 9 years ago
Implemented thread safety. In the long run it might be nicer to make I18n 
immutable
and have change listeners update the locale instance maybe.

Will commit in the next few days.

Original comment by berge...@gmail.com on 10 Apr 2008 at 5:02

Attachments:

GoogleCodeExporter commented 9 years ago
Committed. Will be part of next release.

Original comment by berge...@gmail.com on 10 Apr 2008 at 5:04

GoogleCodeExporter commented 9 years ago
A new release has been published that contains the fix for this issue.

Original comment by berge...@gmail.com on 17 Jul 2008 at 2:02