Re: Entries still appearing in the DataObject after deleting them inthe database

From: Mike Kienenberger (mkienen..laska.net)
Date: Fri Feb 18 2005 - 14:55:13 EST

  • Next message: Fredrik Liden: "String as Primary Key"

    Fredrik Liden <flide..ranslate.com> wrote:
    > Woah, I think I'll try not to go outside of Cayenne. That's a cool
    > solution though.
    > Did you try the optimistic locking and found it to be to slow? is there
    > any risk of dead-locks?

    No, I also use optimistic locking. The strategy below is only good for
    regularly-scheduled updates, not for real-time updates.
    Optimistic locking has almost no performance issues (it's just attaching
    additional qualifiers to each update and delete request).
    Optimistic locking doesn't actually lock anything in the database, it just
    guarantees that the operation fails if the data has already changed.

    That's why it's optimistic locking -- it optimistically assumes that any
    update will succeed, and you simply have to perform recovery if the
    operation fails.

    If it fails due to an OptimisticLockException, it means that something
    external to your program updated the record since you last selected it.

    -Mike



    This archive was generated by hypermail 2.0.0 : Fri Feb 18 2005 - 14:54:37 EST