(CAY-357) Ability to set optimistic locking on a per-query basis

From: Gili (cowwo..bs.darktech.org)
Date: Sun Sep 04 2005 - 14:31:09 EDT

  • Next message: Gili: "(CAY-362) Delete orphans"

    My actual use-case goes something like this...

    I have a table ImageCache. Normally when I hit images inside it, I want
    to operate with optimistic locking disabled because consistency is not
    so important (the cache algorithm is tolerant of slight errors) and it
    is improves performance to ignore update collisions.

    However, every X number of inserts into the cache, I need to sort the
    entries by score and discard the lowest Y entries to ensure the cache
    size does not outgrow a set limit. In such a case I think I would like
    to have optimistic locking enabled.

    All I'm trying to say with this issue is that it should be possible for
    one to toggle the optimistic-locking state of fields programmatically
    during runtime. Ideally, I should be able to toggle this on a per
    DataObject basis. What do you think?

    Gili

    jira-norepl..bjectstyle.org wrote:
    > Message:
    >
    > The following issue has been closed.
    >
    > Resolver: Andrus Adamchik
    > Date: Sun, 4 Sep 2005 1:02 AM
    >
    > makes no sense ... batch updates are the only queries that have any relation to optimistic locking and they are never invoked directly.
    > ---------------------------------------------------------------------
    > View the issue:
    >
    > http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-357
    >
    >
    > Here is an overview of the issue:
    > ---------------------------------------------------------------------
    > Key: CAY-357
    > Summary: Ability to set optimistic locking on a per-query basis
    > Type: Improvement
    >
    > Status: Closed
    > Priority: Minor
    > Resolution: WON'T FIX
    >
    > Project: Cayenne
    > Components:
    > Cayenne Core Library
    > Versions:
    > 1.2 [DEV]
    >
    > Assignee: Andrus Adamchik
    > Reporter: Gili Tzabari
    >
    > Created: Mon, 29 Aug 2005 2:47 PM
    > Updated: Sun, 4 Sep 2005 1:02 AM
    >
    > Description:
    > We should be able to override whether optimistic locking gets used or not on a per-query basis. Mike suggested it might be enough to override isUsingOptimisticLocking() but this value gets used in prepareQueries(); what happens in between prepareQueries() and commitChanges()?
    >
    > We should be able to:
    >
    > createQuery
    > query.setOptimisticLocking(false);
    > useQuery1
    > query.setOptimisticLocking(true)
    > useQuery2
    >
    > and optimistic locking is applied with different values at point useQuery1 and useQuery2.
    >
    >
    > ---------------------------------------------------------------------
    > JIRA INFORMATION:
    > This message is automatically generated by JIRA.
    >
    > If you think it was sent incorrectly contact one of the administrators:
    > http://objectstyle.org/jira/secure/Administrators.jspa
    >
    > If you want more information on JIRA, or have a bug to report see:
    > http://www.atlassian.com/software/jira
    >
    >

    -- 
    http://www.desktopbeautifier.com/
    



    This archive was generated by hypermail 2.0.0 : Sun Sep 04 2005 - 14:31:08 EDT