cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAY-1557) Vertical inheritance is broken for subclasses with more than one flattened attribute
Date Wed, 13 Apr 2011 07:37:05 GMT

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

Andrus Adamchik commented on CAY-1557:
--------------------------------------

Thanks for thorough report and patches. I will try to review them tonight.

> Vertical inheritance is broken for subclasses with more than one flattened attribute
> ------------------------------------------------------------------------------------
>
>                 Key: CAY-1557
>                 URL: https://issues.apache.org/jira/browse/CAY-1557
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 3.1M3
>            Reporter: Victor Antonovich
>         Attachments: vertical_inheritance_duplicated_inserts.patch, vertical_inheritance_duplicated_inserts_test.patch,
vertical_inheritance_duplicated_inserts_test1.patch, vertical_inheritance_update_subclass_attrs.patch
>
>
> In vertical inheritance mapping model, children objects with multiple flattened attributes
are handled incorrectly while inserting in database. Cayenne is trying to do as many duplicated
INSERTs in children tables as number of flattened attributes in subclass. As example, attached
testcase fails with next log messages:
> INFO: --- transaction started.
> Apr 11, 2011 10:42:25 AM org.apache.cayenne.log.CommonsJdbcEventLogger logQuery
> INFO: INSERT INTO IV_ROOT (DISCRIMINATOR, ID, NAME) VALUES (?, ?, ?)
> Apr 11, 2011 10:42:25 AM org.apache.cayenne.log.CommonsJdbcEventLogger logQueryParameters
> INFO: [bind: 1->DISCRIMINATOR:'IvSub2', 2->ID:203, 3->NAME:'XyZX']
> Apr 11, 2011 10:42:25 AM org.apache.cayenne.log.CommonsJdbcEventLogger logUpdateCount
> INFO: === updated 1 row.
> Apr 11, 2011 10:42:25 AM org.apache.cayenne.log.CommonsJdbcEventLogger logQuery
> INFO: INSERT INTO IV_SUB2 (ID, SUB2_ATTR, SUB2_NAME) VALUES (?, ?, ?)
> Apr 11, 2011 10:42:25 AM org.apache.cayenne.log.CommonsJdbcEventLogger logQueryParameters
> INFO: [bind: 1->ID:203, 2->SUB2_ATTR:NULL, 3->SUB2_NAME:NULL]
> Apr 11, 2011 10:42:25 AM org.apache.cayenne.log.CommonsJdbcEventLogger logUpdateCount
> INFO: === updated 1 row.
> Apr 11, 2011 10:42:25 AM org.apache.cayenne.log.CommonsJdbcEventLogger logQueryParameters
> INFO: [bind: 1->ID:203, 2->SUB2_ATTR:NULL, 3->SUB2_NAME:NULL]
> Apr 11, 2011 10:42:25 AM org.apache.cayenne.log.CommonsJdbcEventLogger logQueryError
> INFO: *** error.
> java.sql.SQLException: Unique constraint violation: SYS_IDX_76 in statement [INSERT INTO
IV_SUB2 (ID, SUB2_ATTR, SUB2_NAME) VALUES (?, ?, ?)]
> 	at org.hsqldb.jdbc.Util.throwError(Unknown Source)
> 	at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)
> 	at org.apache.cayenne.access.jdbc.BatchAction.runAsIndividualQueries(BatchAction.java:205)
> 	at org.apache.cayenne.access.jdbc.BatchAction.performAction(BatchAction.java:86)
> 	at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:87)
> 	at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:254)
> 	at org.apache.cayenne.access.DataDomainFlushAction.runQueries(DataDomainFlushAction.java:226)
> 	at org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:144)
> 	at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:796)
> 	at org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:763)
> 	at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:822)
> 	at org.apache.cayenne.access.DataDomain.onSyncNoFilters(DataDomain.java:760)
> 	at org.apache.cayenne.access.DataDomain$DataDomainSyncFilterChain.onSync(DataDomain.java:966)
> 	at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:731)
> 	at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:811)
> 	at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:750)
> 	at org.apache.cayenne.access.VerticalInheritanceTest.testInsert_Sub2(VerticalInheritanceTest.java:139)
> 	...

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message