[ 
https://issues.apache.org/jira/browse/TUSCANY-826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Brian Murray updated TUSCANY-826:
---------------------------------

    Attachment: 826.patch
                826.zip

Attaching 826.zip (the test case with needed files) and 826.patch.

After the patch the following is true:
*  As agreed upon, no exception is thrown when a containment cycle is 
established.  (This is a deviation from the 2.1 specification.)
*  XMLHelper and XMLStreamHelper serialization will complete.  The serialized 
XML will not show the containment cycle and the Object passed as a parm to 
XMLHelper.save or XMLStreamHelper.saveObject will be treated as the root.
*  Java serialization of a containment cycle will throw an 
IllegalStateException.  This matches with the behavior of getRootObject().  
That Java serialization may not complete while the others may has been deemed 
appropriate given that Java serialization serializes from the root object (the 
identity of which is unclear in the event of a containment cycle).

In the test case the static cases have been commented out.  This is because (in 
the static case) a method in ObjectOutputStream (from the JVM) is catching the 
IllegalStateException.  This allows the attempted serialization to continue 
resulting in the StackOverflowException.  In fact, the method is catching 
RuntimeException which does not allow us to get around the problem by changing 
which Exception is thrown.  This is a defect outside of SDO, which Paul is 
helping me to isolate.  

> Containment cycle should result in Exception
> --------------------------------------------
>
>                 Key: TUSCANY-826
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-826
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-Mx
>         Environment: Windows XP, both Sun and IBM JVMs
>            Reporter: Brian Murray
>             Fix For: Java-SDO-Mx
>
>         Attachments: 826.patch, 826.zip, ContainmentCycle.patch, 
> ContainmentCycleError.java, ContainmentTest.zip
>
>
> Near the bottom of page 19 in the 2.0.1 specification it is stated that 
> "Containment cannot have cycles.  If a set or add would create a containment 
> cycle an exception is thrown."
> However, I have found that no such exception is thrown.  I will attach a test 
> case showing the creation of (and the potential to infinitely loop through) a 
> containment cycle.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to