You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Jan Schaumlöffel (JIRA)" <ji...@apache.org> on 2010/12/06 12:05:12 UTC

[jira] Created: (CAY-1520) Deleting Objects with Flattened Read-Only Relationships

Deleting Objects with Flattened Read-Only Relationships
-------------------------------------------------------

                 Key: CAY-1520
                 URL: https://issues.apache.org/jira/browse/CAY-1520
             Project: Cayenne
          Issue Type: Bug
    Affects Versions: 3.0.1
         Environment: multiple
            Reporter: Jan Schaumlöffel


When deleting an object with a flattened read-only relationship an exception is thrown:

{quote}
Caused by: org.apache.cayenne.CayenneRuntimeException: [v.3.0.1 Sep 06 2010 15:09:38] Cannot unset the read-only flattened relationship runtimeRelationship0
	at org.apache.cayenne.access.DataDomainIndirectDiffBuilder.arcDeleted(DataDomainIndirectDiffBuilder.java:123)
	at org.apache.cayenne.access.ObjectDiff$ArcOperation.apply(ObjectDiff.java:440)
	at org.apache.cayenne.graph.CompoundDiff.apply(CompoundDiff.java:91)
	at org.apache.cayenne.access.ObjectStoreGraphDiff.apply(ObjectStoreGraphDiff.java:134)
	at org.apache.cayenne.access.DataDomainIndirectDiffBuilder.processIndirectChanges(DataDomainIndirectDiffBuilder.java:59)
	at org.apache.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:180)
	at org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:134)
	at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:824)
	at org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:791)
	at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:850)
	at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:788)
	at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1106)
	at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1045)
...
{quote}

It might be the same issue as CAY-784, but I haven't looked at the code yet.

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


[jira] Commented: (CAY-1520) Deleting Objects with Flattened Read-Only Relationships

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12967160#action_12967160 ] 

Andrus Adamchik commented on CAY-1520:
--------------------------------------

Good to know that you found a workaround. Runtime relationships (those relationships created implicitly by Cayenne to avoid forcing users to create them), are causing quite a bit of trouble in a number of mapping scenarios. So here we have another one.

> Deleting Objects with Flattened Read-Only Relationships
> -------------------------------------------------------
>
>                 Key: CAY-1520
>                 URL: https://issues.apache.org/jira/browse/CAY-1520
>             Project: Cayenne
>          Issue Type: Bug
>    Affects Versions: 3.0.1
>         Environment: multiple
>            Reporter: Jan Schaumlöffel
>
> When deleting an object with a flattened read-only relationship an exception is thrown:
> Caused by: org.apache.cayenne.CayenneRuntimeException: [v.3.0.1 Sep 06 2010 15:09:38] Cannot unset the read-only flattened relationship runtimeRelationship0
> 	at org.apache.cayenne.access.DataDomainIndirectDiffBuilder.arcDeleted(DataDomainIndirectDiffBuilder.java:123)
> 	at org.apache.cayenne.access.ObjectDiff$ArcOperation.apply(ObjectDiff.java:440)
> 	at org.apache.cayenne.graph.CompoundDiff.apply(CompoundDiff.java:91)
> 	at org.apache.cayenne.access.ObjectStoreGraphDiff.apply(ObjectStoreGraphDiff.java:134)
> 	at org.apache.cayenne.access.DataDomainIndirectDiffBuilder.processIndirectChanges(DataDomainIndirectDiffBuilder.java:59)
> 	at org.apache.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:180)
> 	at org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:134)
> 	at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:824)
> 	at org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:791)
> 	at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:850)
> 	at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:788)
> 	at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1106)
> 	at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1045)
> ...
> It might be the same issue as CAY-784, but I haven't looked at the code yet.

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


[jira] Closed: (CAY-1520) Deleting Objects with Flattened Read-Only Relationships

Posted by "Jan Schaumlöffel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jan Schaumlöffel closed CAY-1520.
---------------------------------

    Resolution: Invalid

Can work around this after inspecting the code, it is not really an issue anyway.

The documentation recommends setting the delete rule to something different from the default "no action" and states that "nullify" does not do anything if there is no reverse relationship. Setting anything but "no action" for a read-only relationship causes this issue.

Might be a good idea to disallow anything but "no action" for read-only relationships in the modeler.

> Deleting Objects with Flattened Read-Only Relationships
> -------------------------------------------------------
>
>                 Key: CAY-1520
>                 URL: https://issues.apache.org/jira/browse/CAY-1520
>             Project: Cayenne
>          Issue Type: Bug
>    Affects Versions: 3.0.1
>         Environment: multiple
>            Reporter: Jan Schaumlöffel
>
> When deleting an object with a flattened read-only relationship an exception is thrown:
> Caused by: org.apache.cayenne.CayenneRuntimeException: [v.3.0.1 Sep 06 2010 15:09:38] Cannot unset the read-only flattened relationship runtimeRelationship0
> 	at org.apache.cayenne.access.DataDomainIndirectDiffBuilder.arcDeleted(DataDomainIndirectDiffBuilder.java:123)
> 	at org.apache.cayenne.access.ObjectDiff$ArcOperation.apply(ObjectDiff.java:440)
> 	at org.apache.cayenne.graph.CompoundDiff.apply(CompoundDiff.java:91)
> 	at org.apache.cayenne.access.ObjectStoreGraphDiff.apply(ObjectStoreGraphDiff.java:134)
> 	at org.apache.cayenne.access.DataDomainIndirectDiffBuilder.processIndirectChanges(DataDomainIndirectDiffBuilder.java:59)
> 	at org.apache.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:180)
> 	at org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:134)
> 	at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:824)
> 	at org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:791)
> 	at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:850)
> 	at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:788)
> 	at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1106)
> 	at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1045)
> ...
> It might be the same issue as CAY-784, but I haven't looked at the code yet.

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


[jira] Updated: (CAY-1520) Deleting Objects with Flattened Read-Only Relationships

Posted by "Jan Schaumlöffel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jan Schaumlöffel updated CAY-1520:
----------------------------------

    Description: 
When deleting an object with a flattened read-only relationship an exception is thrown:

Caused by: org.apache.cayenne.CayenneRuntimeException: [v.3.0.1 Sep 06 2010 15:09:38] Cannot unset the read-only flattened relationship runtimeRelationship0
	at org.apache.cayenne.access.DataDomainIndirectDiffBuilder.arcDeleted(DataDomainIndirectDiffBuilder.java:123)
	at org.apache.cayenne.access.ObjectDiff$ArcOperation.apply(ObjectDiff.java:440)
	at org.apache.cayenne.graph.CompoundDiff.apply(CompoundDiff.java:91)
	at org.apache.cayenne.access.ObjectStoreGraphDiff.apply(ObjectStoreGraphDiff.java:134)
	at org.apache.cayenne.access.DataDomainIndirectDiffBuilder.processIndirectChanges(DataDomainIndirectDiffBuilder.java:59)
	at org.apache.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:180)
	at org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:134)
	at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:824)
	at org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:791)
	at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:850)
	at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:788)
	at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1106)
	at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1045)
...

It might be the same issue as CAY-784, but I haven't looked at the code yet.

  was:
When deleting an object with a flattened read-only relationship an exception is thrown:

{quote}
Caused by: org.apache.cayenne.CayenneRuntimeException: [v.3.0.1 Sep 06 2010 15:09:38] Cannot unset the read-only flattened relationship runtimeRelationship0
	at org.apache.cayenne.access.DataDomainIndirectDiffBuilder.arcDeleted(DataDomainIndirectDiffBuilder.java:123)
	at org.apache.cayenne.access.ObjectDiff$ArcOperation.apply(ObjectDiff.java:440)
	at org.apache.cayenne.graph.CompoundDiff.apply(CompoundDiff.java:91)
	at org.apache.cayenne.access.ObjectStoreGraphDiff.apply(ObjectStoreGraphDiff.java:134)
	at org.apache.cayenne.access.DataDomainIndirectDiffBuilder.processIndirectChanges(DataDomainIndirectDiffBuilder.java:59)
	at org.apache.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:180)
	at org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:134)
	at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:824)
	at org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:791)
	at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:850)
	at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:788)
	at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1106)
	at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1045)
...
{quote}

It might be the same issue as CAY-784, but I haven't looked at the code yet.


Removed markup that does not work in this version of JIRA.

> Deleting Objects with Flattened Read-Only Relationships
> -------------------------------------------------------
>
>                 Key: CAY-1520
>                 URL: https://issues.apache.org/jira/browse/CAY-1520
>             Project: Cayenne
>          Issue Type: Bug
>    Affects Versions: 3.0.1
>         Environment: multiple
>            Reporter: Jan Schaumlöffel
>
> When deleting an object with a flattened read-only relationship an exception is thrown:
> Caused by: org.apache.cayenne.CayenneRuntimeException: [v.3.0.1 Sep 06 2010 15:09:38] Cannot unset the read-only flattened relationship runtimeRelationship0
> 	at org.apache.cayenne.access.DataDomainIndirectDiffBuilder.arcDeleted(DataDomainIndirectDiffBuilder.java:123)
> 	at org.apache.cayenne.access.ObjectDiff$ArcOperation.apply(ObjectDiff.java:440)
> 	at org.apache.cayenne.graph.CompoundDiff.apply(CompoundDiff.java:91)
> 	at org.apache.cayenne.access.ObjectStoreGraphDiff.apply(ObjectStoreGraphDiff.java:134)
> 	at org.apache.cayenne.access.DataDomainIndirectDiffBuilder.processIndirectChanges(DataDomainIndirectDiffBuilder.java:59)
> 	at org.apache.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:180)
> 	at org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:134)
> 	at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:824)
> 	at org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:791)
> 	at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:850)
> 	at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:788)
> 	at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1106)
> 	at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1045)
> ...
> It might be the same issue as CAY-784, but I haven't looked at the code yet.

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