Issue Details (XML | Word | Printable)

Key: HHH-2087
Type: Bug Bug
Status: Open Open
Priority: Critical Critical
Assignee: Unassigned
Reporter: Max Rydahl Andersen
Votes: 2
Watchers: 3
Operations

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

lazy="extra" on Set's is broken - operationQueue is not considered when accessing set

Created: 19/Sep/06 04:44 AM   Updated: 19/Sep/06 10:52 AM
Component/s: core
Affects Version/s: 3.2.0.cr4
Fix Version/s: None

Time Tracking:
Not Specified

Bug Testcase Reminder (view):
REMINDER: Bug reports should generally be accompanied by a test case
Participants: Max Rydahl Andersen


 Description  « Hide

adding to a loaded list is not reflected in the .size() method (and addAll() is possibly also affected)

I created ExtraLazyTest.testExtraLazySet in the test suite that shows the issue.

User person = (User) s.get(User.class, gavin.getName());

new Document( "Fresh", "word", person );
System.out.println("Writing out the persons documentes (Set). Expected to find 3 but it only contains 2.");

for (Iterator iter = person.getDocuments().iterator(); iter.hasNext() { // changes should be written at this time... Document doc = (Document) iter.next(); System.out.println("phoneNumber: " + doc); }

assertTrue(person.getDocuments().size() == 3);

Changing PeristentSet.endRead() to:
public boolean endRead() { set.addAll(tempList); tempList = null; return afterInitialize(); // ensures that operationQueue is considered. }

makes it work.



Max Rydahl Andersen added a comment - 19/Sep/06 10:52 AM

its actually not really an issue limited to size() but that .iterate() does not return the actually added objects.