You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "John Huss (JIRA)" <ji...@apache.org> on 2015/06/24 21:09:05 UTC

[jira] [Commented] (CAY-1896) Flattened attributes don't work with optimistic locking on

    [ https://issues.apache.org/jira/browse/CAY-1896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14599972#comment-14599972 ] 

John Huss commented on CAY-1896:
--------------------------------

Any thoughts on this?  Maybe the modeler should just disallow locking flattened attributes and the runtime can ignore locks on them.

Are there any more docs coming on flattened attributes?  It would be nice to flesh out how these are supposed to work.

> Flattened attributes don't work with optimistic locking on
> ----------------------------------------------------------
>
>                 Key: CAY-1896
>                 URL: https://issues.apache.org/jira/browse/CAY-1896
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 3.2.M1
>            Reporter: John Huss
>         Attachments: 0001-Fix-flattened-attributes.patch, cayenne-mvn-snippet.zip
>
>
> Flattened attributes can not be modified and saved with if you have optimistic locking turned on for a to-one relationship in the same entity with the flattened attribute.  
> For example, say you have Artist and Painting and a flattened attribute "artistName" on Painting and you set this to a new value.  And you also have optimistic locking on the Painting.artist relationship.  It tries to generate SQL for the flattened object (Artist) that includes the to-one relationship foreign key from the source object (Painting) and fails because the column is not found:
> UPDATE ARTIST SET NAME = ? WHERE ID IS NULL AND ARTIST_ID = ?
> Column 'ARTIST_ID' is either not in any table in the FROM list...
> A minimal example is attached.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)