[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Proxy problem



I think I know the answer to this one but I will share it in
case I am missing something.

The problem is when a database object refernces the object
that is currently referencing it, it fails.

Here is a code illustration:
All of my *Impl classes are database objects  *Impl_Int are
the interfaces.

planetImpl_Int pl = db.objectForName(...);

pl.getRaceInfo();

...in planetImpl.java
public String getRaceHomeInfo() {
        String home = race.getHomeInfo();
    return home;
}

... in raceImpl.java
public String  getHomeInfo() {
    return homePlanet.getName();  <<------- the
planetImpl_Proxy fails here because homePlanet == pl which
called this method.
}

It has taken me much debugging to figure this out.  As it
stand now it seems I must pass the calling reference in so I
can check to see if the calling planetImpl_Int == the one I
want to access.  If so I must not do it.  It is the
recurrsion that seems to be the problem.  Understand?

Any ideas?
Thanks,
Tim


--
Tim Brown
URL: http://www.incenter.org