RE: Getting info across databases...

From: Michal Kozlowski (mkozlowsk..MVProjects.com)
Date: Thu Nov 18 2004 - 09:56:20 EST

  • Next message: Gentry, Michael: "How do you create a custom DB Adapter?"

    Andrus,

    I believe that I have them going both ways, here are the xml files.

    I would like to send some data since it's very reproducable on my end, but these things are huge. I'm really hoping this isn't something wrong with my files. If these files don't help I'll see if I can create mySQL scripts that will generate some test data and maybe some java code so we could be on the same page :o) Do you know of any way of creating SQL scripts from existing data?

    But for now here are my new and old cayenne files, the old one are after I removed locking from the dataObjects but before I removed the link.

    Cheers
    Mike

    -----Original Message-----
    From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    Sent: Thursday, November 18, 2004 7:20 AM
    To: cayenne-use..bjectstyle.org
    Subject: RE: Getting info across databases...

    Michal,

    I looked at CAY-231 submitted by Bryan, and I suspect that his problem
    happens cause to-many object relationship doesn't have a reverse to-one
    (this is currently a requirement in Cayenne -
    http://objectstyle.org/cayenne/modelerguide/modeling-tips.html). Is it
    possible that you have the same situation?

    Our archiver messed u the XML files you uploaded with the earlier message,
    so I can't doublecheck this from here.

    Andrus

    > Okay here is another quirk that is definetly related, the original
    > problem I posted created as you know the query
    >
    > SELECT t0.Disabled, t0.FirstName, t0.LastName, t0.LoginName, t0.UserId,
    > t0.UnitId FROM dbo._UserInfo t0 WHERE t0.UnitId = NULL
    >
    > and this was going from
    > Discipline.externalId -> _UserInfo.UnitId
    >
    > now there is another relation that links user's to discipline and that
    > is a double join table, which I don't flatten.
    >
    > Discipline.id ->
    > ProjectDisciplin.disciplineId
    > ProjectDisicpline.id ->
    > ProjectDisciplineUser.projectDisciplineId
    > ProjectDisciplineUser.userId ->
    > _UserInfo.UserId
    >
    > now here's the kicker, when I create a new ProjectDisciplineUser
    > relationship, it creates but the problem is that it tries to updata the
    > _UserInfo.UnitId to NULL. Now this is a locked object as it is on a
    > seperate live database, so it give me an exception. But the error is
    > cause by an UPDATE query that is updating the UserId(to whatever userId
    > i'm setting) and the UnitId(to NULL).
    >
    > Now when I remove the link in the cayenne files between
    > Discipline.externalId -> _UserInfo.UnitId
    > everything works great. This is the link that created my original
    > problem/posting. I have a very strong feeling these a related but I
    > really don't know why the field would be set to NULL.
    >
    > Thanks for all this help.
    >
    > Cheers
    > Mike
    >
    > -----Original Message-----
    > From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    > Sent: Tuesday, November 09, 2004 7:04 PM
    > To: cayenne-use..bjectstyle.org
    > Subject: Re: Getting info across databases...
    >
    >
    > Let me take a look at the bug report. That indeed looks strange. Thanks
    > for the test case!
    >
    > Andrus
    >
    > On Nov 9, 2004, at 12:22 PM, Bryan Lewis wrote:
    >
    >> I think I can help on reproducing the problem. We ran into the same
    >> issue today with a SQL statement ending in "= NULL", for no good
    >> reason that we can see. It's a simple one-to-many relationship using
    >> a VARCHAR field as the key.
    >>
    >> I had a good test case from a previous bug report that seemed to work
    >> well for Andrus. I've updated it to cover this case and submitted it
    >> as CAY-231.
    >>
    >>
    >> Michal Kozlowski wrote:
    >>
    >>> I feel I'm doing something wrong b/c you couldn't reproduce the
    >>> problem.







    This archive was generated by hypermail 2.0.0 : Thu Nov 18 2004 - 09:57:49 EST