Re: To Dep PK and MySQL

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Mar 26 2003 - 14:27:14 EST

  • Next message: Noel Murphy: "Creating / Deleting an object == NullPointer"

    Jason,

    > I am using MySQL where I have a relational entity A_B which acts as a
    > join between tables A and B. In the cayenne modeler I have specified in
    > the database entity that the primary key of A_B is A_ID and B_ID and
    > made sure to check the "To Dep PK" box for each of these relationships.
    > When I try to commit changes after adding a new A_B object entity I get
    > the exception "Error generating PK" which I beleive the root cause is
    > from the

    I understand that you have 3 Db (and Obj) entities in question:

    A - A_B - B

    In this case the relationships going from A -> A_B and B -> A_B should be
    marked as "To Dep PK", since keys in A_B depend on keys in A and B. If
    this doesn't help, also check that your MySQL schema has all needed
    objects for the automated primary key support per this page:

      http://objectstyle.org/cayenne/modelerguide/pksupport.html

    If this doesn't help either, you can send me the datamap privately, I'll
    take a look.

    > SQLException "Cannot disable AUTO_COMMIT" from the MySQL
    > driver.

    Umm... this looks strange. What version of Cayenne are you running? Could
    you post all exceptions thrown?

    Andrus



    This archive was generated by hypermail 2.0.0 : Wed Mar 26 2003 - 14:27:15 EST