Click
  1. Click
  2. CLK-307

CayenneForm: new entry saved multiple times

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: extras
    • Labels:
      None

      Description

      When a user wants to create a new entry in a CayenneForm and save the new entry multiple times, multiple inserts are performed in the database. The reason for this is that the new/generated primary key value is not included in the hidden oid field.

        Activity

        Hide
        Malcolm Edgar added a comment -

        Fix checked in and will be available in release 1.4

        Show
        Malcolm Edgar added a comment - Fix checked in and will be available in release 1.4
        Hide
        Tore Halset added a comment -

        It looks like CayenneForm tried to handle this situation in its toString. Somehow it did not work.

        Show
        Tore Halset added a comment - It looks like CayenneForm tried to handle this situation in its toString. Somehow it did not work.
        Hide
        Tore Halset added a comment -

        The patch does not replace CayenneDataObject with DataObject. It just cast the result of DataObjectUtils.objectForPK() as it returns Object in 3.0 to support pojo.

        Show
        Tore Halset added a comment - The patch does not replace CayenneDataObject with DataObject. It just cast the result of DataObjectUtils.objectForPK() as it returns Object in 3.0 to support pojo.
        Hide
        Tore Halset added a comment -

        That is all needed to get click to compile with cayenne-3.0M3, but I think click compiled with cayenne-2 is not usable with cayenne-3 as some signatures has changed.

        The reason for the signature change and the new casts is that cayenne 3 support persisting pojo in addition to DataObject.

        Show
        Tore Halset added a comment - That is all needed to get click to compile with cayenne-3.0M3, but I think click compiled with cayenne-2 is not usable with cayenne-3 as some signatures has changed. The reason for the signature change and the new casts is that cayenne 3 support persisting pojo in addition to DataObject.
        Hide
        Malcolm Edgar added a comment -

        Hi Tore,

        I haven't yet dealt with upgrading the Cayenne 3.0, is that all we need to do replace CayenneDataObject references with DataObject?

        regards Malcolm Edgar

        Show
        Malcolm Edgar added a comment - Hi Tore, I haven't yet dealt with upgrading the Cayenne 3.0, is that all we need to do replace CayenneDataObject references with DataObject? regards Malcolm Edgar
        Hide
        Tore Halset added a comment -

        This patch fixes this bug for me. It also has some DataObject casts needed to build click with cayenne-3.0M3

        Show
        Tore Halset added a comment - This patch fixes this bug for me. It also has some DataObject casts needed to build click with cayenne-3.0M3

          People

          • Assignee:
            Malcolm Edgar
            Reporter:
            Tore Halset
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development