Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316145

Summary: [DB] Revision list values loads NULL
Product: [Modeling] EMF Reporter: Egidijus Vaisnora <vaisegid>
Component: cdo.dbAssignee: Eike Stepper <stepper>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3 CC: saulius.tvarijonas, vroldanbet
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Short test illustrating problem
none
Added checking for NULL result in ResultSet none

Description Egidijus Vaisnora CLA 2010-06-08 10:43:17 EDT
Build Identifier: I20100513-1500

If CDOObject contains reference list and revision is not held in cache, then loaded revision contains NULL value in reference null, if revision was loaded with *referenceChunk=0* rule. This leads to NPE.

Reproducible: Always
Comment 1 Egidijus Vaisnora CLA 2010-06-08 10:46:42 EDT
Created attachment 171410 [details]
Short test illustrating problem

Iterating over object contents produces NPE
Comment 2 Victor Roldan Betancort CLA 2010-06-08 10:52:00 EDT
I'm experiencing the same problem, but even with refereceChunk!=0.

This bug is being driving me crazy :(
Comment 3 Egidijus Vaisnora CLA 2010-06-08 10:54:25 EDT
Created attachment 171413 [details]
Added checking for NULL result in ResultSet
Comment 4 Egidijus Vaisnora CLA 2010-06-08 10:58:01 EDT
Yes, because it depends on the result, which was stored in a cache. If in cache there is wrong revision, then you get wrong result on any loading policy. 

It was driving me crazy for a couple of days too, but seems to be finished ;)
Comment 5 Victor Roldan Betancort CLA 2010-06-08 11:09:11 EDT
Thanks Egidijus! This fix is so much welcome :D
Comment 6 Egidijus Vaisnora CLA 2010-06-08 11:24:44 EDT
1) The number of lines I have changed is smaller than 250.
2) I am an author of these changed lines.
3) I apply the EPL to these changed lines.
Comment 7 Eike Stepper CLA 2010-06-08 11:27:04 EDT
THanks guys!

Committed to HEAD
Comment 8 Eike Stepper CLA 2010-06-29 04:36:05 EDT
Available in 3.0 GA:
http://download.eclipse.org/modeling/emf/cdo/updates/3.0-releases/