Getting info across databases...

From: Michal Kozlowski (mkozlowsk..MVProjects.com)
Date: Mon Nov 08 2004 - 14:58:40 EST

  • Next message: Andrus Adamchik: "Re: Getting info across databases..."

    Hi,
    Firstly thanks again for all the help you guys are offering me, and for the great product. I ran into a simple problem, which normally works but for some reason it don't work for this situation.

    I have 2 tables, they are on separate databases, so I have 2 DataNodes, this normally isn't a problem as I have done this a couple of times. In this case I have one table Discipline that is related to a table(view) _UserInfo. The relation is Discipline->ExternalId = _UserInfo->UnitId. My Object Entities are Discipline and User, and I create a relationship called UserList and Discipline respectively to navigate the relationship. Problem is it doesn't work when I go Discipline.getUserList I get an empty list back and I should, the reason is that is create this query which have errors

    INFO QueryLogger: SELECT t0.Disabled, t0.FirstName, t0.LastName, t0.LoginName, t0.UserId, t0.UnitId FROM dbo._UserInfo t0 WHERE t0.UnitId = NULL
    INFO QueryLogger: === returned 0 rows. - took 0 ms.
    INFO QueryLogger: +++ no commit - transaction controlled externally.

    The NULL field should not be there, it is a valid field that is set to not be NULL, I wrote a overloading function for getUserList that looks like this and it works

      public List getUserList()
      {
        Expression qualifier = ExpressionFactory.matchDbExp("UnitId", new BigDecimal(4));
        
        SelectQuery query = new SelectQuery(User.class, qualifier);
        query.setName("UserSelect");
        query.setCachePolicy(GenericSelectQuery.LOCAL_CACHE);
        query.setRefreshingObjects(false);
        
        List disciplineUsers = getDataContext().performQuery(query);
        return disciplineUsers;
      }

    So my question is what am I doing wrong in my cayenne information which I am attaching as well.

    Secondly how do I change the logging level of a query, I tried setting this up but I can't figure out were to put the cayenne-log.properties file. I running this as a tapestry application under Tomcat. Thanks for all the information and support.

    Cheers
    Mike













    This archive was generated by hypermail 2.0.0 : Mon Nov 08 2004 - 15:00:11 EST