Re: update of many to many

From: Tore Halset (halse..vv.ntnu.no)
Date: Mon Aug 25 2003 - 07:58:30 EDT

  • Next message: Martin Dengler: "cayenne and object caching"

    On Mon, 25 Aug 2003, Tore Halset wrote:

    > It did not fix the problem. Sorry. Any tip for debugging this problem?

    Here are output from QueryLogger and debug from DataContext.

    First: The following code does not change anything in the database:
    myUser.addToCountrycodes(aCountrycode);
    ctx.commitChanges();
    The log/debug:
    QueryLogger] --- will run 1 query.
    QueryLogger] SELECT ... FROM public.countrycode t0
    QueryLogger] === returned 239 rows. - took 10 ms.
    DataContext] registerFlattenedRelationshipInsert for source of class
    ....User, rel=countrycodes, destination class=....Countrycode
    DataContext] This combination is not currently inserted... ok
    QueryLogger] --- will run 1 query.
    QueryLogger] SELECT DISTINCT ...
     FROM public.user_ t0, public.user_countrycode t1 WHERE t0.user_name =
    t1.user_n
    ame AND (RTRIM(t1.countrycode_id) = ?) [bind: 'GW']
    QueryLogger] === returned 0 rows. - took 0 ms.
    QueryLogger] --- will run 1 query.

    Second: The flatten many-to-many are updated after changing another
    property on the user object
    myUser.setUserFullName("Tore Halset 2");
    log/debug output:
    QueryLogger] --- will run 1 query.
    QueryLogger] SELECT ... FROM public.countrycode t0
    QueryLogger] === returned 239 rows. - took 10 ms.
    ContextCommit] Creating InsertBatchQuery for DbEntity user_countrycode
    QueryLogger] --- will run 2 queries.
    QueryLogger] INSERT INTO public.user_countrycode (countrycode_id,
    user_name) VALUES (?, ?)
    QueryLogger] [bind: 'GW', 'halset2']
    QueryLogger] === updated 1 row.
    QueryLogger] UPDATE public.user_ SET user_fullname = ? WHERE user_name = ?
    QueryLogger] [bind: 'Tore Halset 2', 'halset2']
    QueryLogger] === updated 1 row.
    QueryLogger] +++ transaction committed.
    ContextCommit] transaction committed
    QueryLogger] --- will run 1 query.

    Regards,
     - Tore.



    This archive was generated by hypermail 2.0.0 : Mon Aug 25 2003 - 07:48:30 EDT