Hi Robert,

OJB can handle cyclic structures for loading and storing.
non-terminating loops are avoided by looking up objects from the cache first. If you set refresh="false" (which is the default) references are not refreshed on picking up objects from the cache. By this simple mechanism we avoid recursions.


1. If you set refresh="true" this could end in endless recursions.
2. If you use the EmptyCacheImpl this will also produce endless loops.

cheers,
Thomas

Robert S. Sfeir wrote:
I'm doing a select which in the repository has a Collection with auto-retrieve="true" and the table which it relates to has its own foreignkey pointing back to the table:

homes
    collection of brokerHomes

brokerHomes
    foreignkey homes

If I select * from brokerHomes where home_id = 1

it correctly auto retrieves the home info and the brokerHomes info... except there is a problem, because the homes have a collection of brokerHomes, it then auto retrieves the brokerHomes collection which contains brokerHomes object which contains the same homes object which containts a collection of brokerHomes... and so on and so forth.

I noticed this while debugging in IDEA and looked at the frame info, and noticed that I could expand the stack in that frame forever.

Is this a bug in the way I have set things up, or is this simply a bunch of references to the same objects? (It doesn't look like it since they all have a different hash)

Thanks
R

--
Robert S. Sfeir
Senior Java Engineer
Codepuccino, Inc.
[EMAIL PROTECTED]

definition - Codepuccino n:
A Little JSP mixed with lots of Java, usually served with Servlets, a Datasource, a sprinkle of XML, and sometimes EJB. (See Great MVC Frameworks)



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





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



Reply via email to