ojb-user@db.apache.org
[Top] [All Lists]

RE: Proxy collection and cyclic references

Subject: RE: Proxy collection and cyclic references
From: "Robert Giddings"
Date: Thu, 15 Nov 2007 17:59:10 -0000
Hi Armin,

I set up all the code to send you only to discover that it worked in
those tests. Even though removing the parent reference solved the
problem, it turns out it is not an OJB problem.
The problem might be a JAXB one, as making the collection in question
Transient and leaving the parent reference (when reading out of OJB)
alone, also "solves" the problem. So I'll have to look into this.
But basically it doesn't seem to be OJB that is at fault.

Sorry.

Rob

-----Original Message-----
From: Armin Waibel [mailto:arminw@xxxxxxxxxx] 
Sent: 15 November 2007 03:00
To: OJB Users List
Subject: Re: Proxy collection and cyclic references

Hi Robert,

Robert Giddings wrote:
> Hi Armin,
> 
> Actually it doesn't seem to have anything to do with Proxies as
setting
> proxy to false while leaving auto-retrieve to true creates the same
> problem.
> 
> As for code enhancements, there are none.
> 
> All my code is doing is reading out an object from the database which
> has encrypted fields. I then run the decrypt method of that object to
> produce a decrypted version. 
> The collections aren't decrypted, but rather assigned to the new
object,
> allowing for proxy collections. 
> When their access method is called their member objects are decrypted.
> Each collection member object has a parent reference to the owner
object
> of the collection and the decrypt method is run on this object when
the
> collection member object is decrypted. 
> However instead of stopping in the loop because eventually the loop
gets
> to a null as is the case with all the other collections one of the
> collections keeps on looping until a StackTraceOverflow. 

For me it's difficult to figure this out without reading your sources. 
In OJB the class responsible to materialize query/collection objects is 
...accesslayer.RsIterator.java. RsIterator use class 
MaterializationCache to avoid endless loops on cyclic object graph 
materialization.
Maybe this can help you to solve the problem.

> I have looked at my code, but it is identical to the code for the
> decrypting of the other collections, leading me to believe that this
is
> an error with OJB in regard to cyclic references.
>

It seems we reached an impasse ;-)
If OJB cause your problem it's mandatory for me to reproduce your 
problem - only this way I can fix it. So please could you send me an 
test to reproduce the problem (keep the test as simple as possible, 
remove all unneeded fields, classes... If OJB cause the problem you 
should be able to write an test without using your en/decrypt methods, 
only 'normal' objects with cyclic references).

regards,
Armin

> Rob
> 
> -----Original Message-----
> From: Armin Waibel [mailto:arminw@xxxxxxxxxx] 
> Sent: 13 November 2007 11:28
> To: OJB Users List
> Subject: Re: Proxy collection and cyclic references
> 
> Hi Robert,
> 
> Robert Giddings wrote:
>> Hi Guys,
>>
>> Has anyone had any trouble with a proxy collection and cyclic
> references
>> before?
>>
>> I keep getting StackTraceOverflow errors because of an infinite loop
>> where a collection of objects of one type has a reference to the
>> collection owner object.
>>
>> However I can't see this as being a problem with my code, because I
> have
>> looked all over the place for an error, but my code in the decrypt
>> method of the objects class is identical to other classes, and they
>> don't have any problem.
> 
> Could you reproduce this error if you remove your enhancements (if
> exist)?
> If yes, please open an issue
> https://issues.apache.org/jira/browse/OJB
> and describe detailed (e.g. with pseudo code) how to reproduce your
> problem.
> 
> If possible please run your test against the latest version from SVN 
> (OJB_1_0_RELEASE branch) - it's stable and will be the 1.0.5rc1. The
OJB
> 
> test-suite run several tests with cyclic references and they all pass,

> so I would expect that this error (if it's one) already fixed in SVN.
> 
> regards,
> Armin
> 
>> Thanks,
>>
>> Rob
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-user-unsubscribe@xxxxxxxxxxxxx
>> For additional commands, e-mail: ojb-user-help@xxxxxxxxxxxxx
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@xxxxxxxxxxxxx
> For additional commands, e-mail: ojb-user-help@xxxxxxxxxxxxx
> 
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@xxxxxxxxxxxxx
For additional commands, e-mail: ojb-user-help@xxxxxxxxxxxxx




-- 
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.32/1131 - Release Date:
14/11/2007 16:54



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@xxxxxxxxxxxxx
For additional commands, e-mail: ojb-user-help@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>