Re: CayenneDataObject#setDataContext()

From: Cris Daniluk (cris.danilu..mail.com)
Date: Wed Sep 14 2005 - 09:13:46 EDT

  • Next message: Gentry, Michael \(Contractor\): "RE: Patch for CAY-360"

    I thought this was just public because CDO and DC are in different
    packages. The DC needs to notify the CDO when there's been a
    registerObject or createAndRegisterObject event.

    On 9/14/05, Kevin Menard <kmenar..ervprise.com> wrote:
    > Hi all,
    >
    > Is there any reason why the aforementioned method does not register
    > the CDO with the DC? I mean, is there any point in calling
    > setDataContext() with a DC that you don't want the CDO registered with?
    >
    > I just spent a few hours debugging a problem where setDataContext()
    > was called with a valid DC. This seemed to satisfy a lot of things
    > in Cayenne, presumably because it just does a simple DC check.
    > However, BatchQueryUtils#buildSnapshotForInsert() which calls
    > getObjectId() on this CDO. Of course, the objectId is null, which
    > causes Cayenne to crap out.
    >
    > So, anyway, something here seems inconsistent.
    >
    > If this is in fact the way it's intended to work for whatever reason,
    > I'll simply open up an RFE for better exception handling in this
    > case. Without having the source available, it's really hard to
    > decipher what went wrong. A simple ("NPE: objectId is null in
    > object" + relname) would have gone a long way in this case.
    >
    > --
    > Kevin
    >



    This archive was generated by hypermail 2.0.0 : Wed Sep 14 2005 - 09:13:48 EDT