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

Bug 330207

Summary: [Hibernate] Placeholder issue for remaining failing testcases
Product: [Modeling] EMF Reporter: Martin Taal <mtaal>
Component: cdo.coreAssignee: Martin Taal <mtaal>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: stepper
Version: 4.0Flags: stepper: review+
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Failed test cases (stacktraces etc.).
none
Patch for solving/working around remaining failing testcases none

Description Martin Taal CLA 2010-11-15 00:33:19 EST
Created attachment 183102 [details]
Failed test cases (stacktraces etc.).

Currently there are 7 testcases failing out of 958 testcases. This bugzilla serves as the placeholder for these failing testcases
Comment 1 Martin Taal CLA 2010-11-15 00:50:17 EST
Some notes:

2 test cases which are part of the ContainmentTest test case fail because of a mismatch in Teneo mapping and CDO behavior. This case is very special and imho has low priority to solve.

The failing testcases:
  public void testModeledBackPointer_Transient_Load() throws Exception
  public void testModeledBackPointer_Transient() throws Exception

Here is a email snippet of an earlier email exchange between myself (Martin) and Eike:

It fails on a containment-container reference pair where the container reference is transient and the containment reference is non-transient.
(the model2 PersistedContainment.children and TransientContainer.parent)

Teneo treats this as a special case and will still persist the transient container reference. Afaics CDO treats the transient as transient and therefore does not persist it.
The reason that Teneo will still persist this transient efeature is that children can be read directly (so not going through their parent) using queries. To still have a valid parent/container reference, transient container references are also persisted. In direct EMF xml/xmi persistence these features do not need to be persisted because there a child is always read through its parent (enforced by the hierarchical xml/xmi structure).

Here is a more detailed behavior of the failure:
Teneo has the TransientContainer.parent ereference mapped to Hibernate. And tries to get a value for this ereference from the CDORevision. It does this by calling the following method:
CDORevisionImpl(AbstractCDORevision).getValue(EStructuralFeature) line: 578   which calls:
CDOClassInfoImpl.getFeatureIndex(EStructuralFeature) line: 81   which calls:
CDOClassInfoImpl.getFeatureIndex(int) line: 91   CDO sees this efeature as transient (the ereference is not part of the CDOClassInfoImpl.allPersistentFeatures but still has a feature index in the CDOClassInfoImpl.featureIDMappings. This array has the following values:
[0,0,1]. The transient efeature has index 1, so the transient ereference and the persisted eattribute are both mapped to the same featureid.
Comment 2 Martin Taal CLA 2010-11-15 01:17:38 EST
Extra note:
I have overridden testcase:
Hibernate_Bugzilla_279982_Test
because Hibernate will treat all stale references as an object not found exception. Although CDO has some more detailed behavior in that it is possible to set this on transaction level. However, this option, example:
    tx.options().setStaleReferenceBehaviour(CDOStaleReferencePolicy.EXCEPTION);

is not readable/present on the server side where Hibernate needs it.
Comment 3 Martin Taal CLA 2010-11-15 03:14:25 EST
Disabled testcase:
Bugzilla_322804_Test
Teneo incorrectly maps lists of int arrays:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=330212
Comment 4 Martin Taal CLA 2010-11-15 03:17:53 EST
The unsupported features reflected by disabling some testcases have been documented here:
http://wiki.eclipse.org/CDO_Hibernate_Store#.28Un.29Supported_Functions_and_Features

gr. Martin
Comment 5 Martin Taal CLA 2010-11-15 03:39:46 EST
Created attachment 183108 [details]
Patch for solving/working around remaining failing testcases

With this patch the CDO Hibernate Store passes all 962 testcases.
Comment 6 Martin Taal CLA 2010-11-15 03:43:20 EST
Committed to cvs
Comment 7 Eike Stepper CLA 2011-06-23 03:41:10 EDT
Available in R20110608-1407