Re: Validation Questions

From: Mike Kienenberger (mkienen..laska.net)
Date: Tue Feb 22 2005 - 16:51:12 EST

  • Next message: Laszlo Spoor: "RE: Validation Questions"

    Fredrik Liden <flide..ranslate.com> wrote:
    > Lets say I use commons validator and then when I press commitChanges the
    Cayenne Validation Exception is thrown and an jsp error page apprears. On
    this page would I need to rollback the transaction here?

    That's an application design issue.

    I design my applications so that data is collected and validated elsewhere,
    and if all goes well, I then create or modify an existing DataObject,
    converting html string form values into proper types, and commit the
    changes. If the commit fails, I roll everything back.

    Other folks read data directly into their DataObjects, and just keep
    recommitting until until it works.

    > And if I don't roll back anything, will there be any unreleased locks on
    some records?

    No, there's no explicit locking in Cayenne. However, your datacontext will
    contain uncommitted changes.



    This archive was generated by hypermail 2.0.0 : Tue Feb 22 2005 - 16:50:35 EST