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
Operations

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 core502.java (0.8 kB)


Forum Thread URL: HTTP://WWW.DataNucleus.org/servlet/forum/viewthread_thread,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