Hi, Is there a problem with getting the SVN commits into the JIRA issues? I thought I had noticed this problem a week or so ago, but then forgot to follow up. I am now noticing it again with my latest commit. I committed these changes early yesterday morning and they are still not attached to the JIRA reports. I thought waiting 24 hours would be sufficient... Any ideas?
Kevin On Jan 17, 2008 9:35 AM, <[EMAIL PROTECTED]> wrote: > Author: kwsutter > Date: Thu Jan 17 07:35:45 2008 > New Revision: 612846 > > URL: http://svn.apache.org/viewvc?rev=612846&view=rev > Log: > OPENJPA-437. Changed AbstractBrokerFactory.loadPersistentTypes to be > synchronized to get around the multi-threading issue during broker creation. > > Also, migrated the change for OPENJPA-449 from trunk to the 1.0.x branch. > > Modified: > > > openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java > > > openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java > > Modified: > openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java > URL: > http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java?rev=612846&r1=612845&r2=612846&view=diff > > ============================================================================== > --- > openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java > (original) > +++ > openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java > Thu Jan 17 07:35:45 2008 > @@ -133,6 +133,7 @@ > */ > protected AbstractBrokerFactory(OpenJPAConfiguration config) { > _conf = config; > + _pcClassLoaders = new ReferenceHashSet(ReferenceHashSet.WEAK); > } > > /** > @@ -231,8 +232,13 @@ > /** > * Load the configured persistent classes list. Performed > automatically > * whenever a broker is created. > + * > + * This method is synchronized due to the possible creation of new > brokers > + * (entity managers) by multiple threads (clients). The two data > structures > + * used by this method (_pcClassNames and _pcClassLoaders) are not > thread > + * safe and this was an easy, efficient solution (OPENJPA-437). > */ > - private void loadPersistentTypes(ClassLoader envLoader) { > + private synchronized void loadPersistentTypes(ClassLoader envLoader) > { > // no listed persistent types? > if (_pcClassNames != null && _pcClassNames.isEmpty()) > return; > @@ -245,7 +251,7 @@ > Collection clss = _conf.getMetaDataRepositoryInstance(). > loadPersistentTypes(false, loader); > if (clss.isEmpty()) > - _pcClassNames = Collections.EMPTY_SET; > + _pcClassNames = Collections.EMPTY_LIST; > else { > _pcClassNames = new ArrayList(clss.size()); > for (Iterator itr = clss.iterator(); itr.hasNext();) { > @@ -254,7 +260,6 @@ > if (needsSub(cls)) > toRedefine.add(cls); > } > - _pcClassLoaders = new ReferenceHashSet( > ReferenceHashSet.WEAK); > _pcClassLoaders.add(loader); > } > } else { > > Modified: > openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java > URL: > http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java?rev=612846&r1=612845&r2=612846&view=diff > > ============================================================================== > --- > openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java > (original) > +++ > openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java > Thu Jan 17 07:35:45 2008 > @@ -256,8 +256,13 @@ > /** > * Load the configured persistent classes list. Performed > automatically > * whenever a broker is created. > + * > + * This method is synchronized due to the possible creation of new > brokers > + * (entity managers) by multiple threads (clients). The two data > structures > + * used by this method (_pcClassNames and _pcClassLoaders) are not > thread > + * safe and this was an easy, efficient solution (OPENJPA-437). > */ > - private void loadPersistentTypes(ClassLoader envLoader) { > + private synchronized void loadPersistentTypes(ClassLoader envLoader) > { > // no listed persistent types? > if (_pcClassNames != null && _pcClassNames.isEmpty()) > return; > @@ -270,7 +275,7 @@ > Collection clss = _conf.getMetaDataRepositoryInstance(). > loadPersistentTypes(false, loader); > if (clss.isEmpty()) > - _pcClassNames = Collections.EMPTY_SET; > + _pcClassNames = Collections.EMPTY_LIST; > else { > _pcClassNames = new ArrayList(clss.size()); > for (Iterator itr = clss.iterator(); itr.hasNext();) { > > >
