DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCCORE-502
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Erik Bengtson
Reporter: Yang ZHONG
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Core

JDOClassLoaderResolver#getResources shouldn't have cached Enumeration

Created: 01/Apr/10 07:16 PM   Updated: 04/Oct/12 05:02 PM   Resolved: 01/Apr/10 10:33 PM
Component/s: Persistence
Affects Version/s: 2.0.0.release, 2.0.1, 2.0.2, 2.0.3
Fix Version/s: 2.0.4, 2.1.0.m1

File Attachments: 1. Java Source File (0.8 kB)

Forum Thread URL: HTTP://,6036
Severity: Production

 Description  « Hide
JDOClassLoaderResolver has a cache:
Map<String, Enumeration> multiResources

1st issue with the cache:

Enumeration#nextElement() will change the state.

Supposing 1st JDOClassLoaderResolver#getResources returning 2 element, 2 Enumeration#nextElement() will empty out.

All following JDOClassLoaderResolver#getResources returns the very same Enumeration which is empty now, because of the cache.

2nd issue with the cache:

if the ClassLoaderResolver cache resources, runtime classloader changes are not going to be effective in datanucleus.

let caching and performance improvements to the underlying classloaders

Sort Order: Ascending order - Click to sort in descending order
Yang ZHONG added a comment - 01/Apr/10 07:45 PM
Test Case is attached.

Erik Bengtson added a comment - 01/Apr/10 10:33 PM
caching of resources removed