You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by "Andrus Adamchik (JIRA)" <de...@cayenne.apache.org> on 2008/01/14 12:04:33 UTC

[JIRA] Created: (CAY-959) Optimistic locking: Implement auto-version attributes

Optimistic locking: Implement auto-version attributes
-----------------------------------------------------

                 Key: CAY-959
                 URL: https://issues.apache.org/cayenne/browse/CAY-959
             Project: Cayenne
          Issue Type: Task
          Components: Cayenne Core Library, Cayenne JPA
    Affects Versions: 3.0
            Reporter: Andrus Adamchik
            Assignee: Andrus Adamchik
             Fix For: 3.0


Per JPA spec , chapter 3.4, we need to support "Version" attribute for optimistic locking. Cayenne already supports optimistic locking, but leaves it up to the user to set the "version" columns. We need to implement auto-versioning on Cayenne end, and bridge it with Cayenne JPA provider.

Cayenne API Tasks:

1. Define ObjAttribute locking type to be LOCK_NONE, LOCK_VERSION, LOCK_MANUAL (make this an enum?)
2. Replace ObjAttribute.usedForLocking property (with deprecation) with the new enum (call it "lockType" or something).
3. Add modeler support for #2.
4. Implement auto-versioning ... the easiest way is probably to use a PRE_PERSIST and PRE_UPDATE callback listener.

JPA Tasks:

5. Bridge JPA @Version mapping with Cayenne mapping (see DataMapConverter).
6. Write integration tests under "jpa-chapter3" module and/or jpa-chpater9 (where @Version annotation is defined).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.