[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2869) Atomic remove + add of unique properties to a persistent set fails

Pietu Pohjalainen (JIRA) noreply at atlassian.com
Mon Oct 1 05:43:25 EDT 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_28261 ] 

Pietu Pohjalainen commented on HHH-2869:
----------------------------------------

The proposed change breaks about few hundred jUnit test cases. As such, it is thus not a feasible change. 

Maybe somebody who actually understands Hibernate architecture could have a look? 

-- broken tests --
- org.hibernate.test.collection.backref.map.compkey.BackrefCompositeMapKeyTest.testOrphanDeleteAfterPersist
- org.hibernate.test.collection.idbag.PersistentIdBagTest.testWriteMethodDirtying
- org.hibernate.test.collection.original.CollectionTest.testExtraLazy
- org.hibernate.test.collection.original.CollectionTest.testMerge
- org.hibernate.test.collection.original.CollectionTest.testFetch
- org.hibernate.test.collection.original.CollectionTest.testUpdateOrder
- org.hibernate.test.collection.original.CollectionTest.testValueMap
- org.hibernate.test.component.cascading.collection.CascadeToComponentCollectionTest.testMerging
- org.hibernate.test.component.cascading.collection.CascadeToComponentCollectionTest.testMergingOriginallyNullComponent
- org.hibernate.test.component.cascading.toone.CascadeToComponentAssociationTest.testMerging
- org.hibernate.test.compositeelement.CompositeElementTest.testHandSQL
- org.hibernate.test.entitymode.dom4j.basic.Dom4jTest.testDom4j
- org.hibernate.test.entitymode.dom4j.basic.Dom4jTest.testMapIndexEmision
- org.hibernate.test.extralazy.ExtraLazyTest.testGet
- org.hibernate.test.extralazy.ExtraLazyTest.testRemoveClear
- org.hibernate.test.extralazy.ExtraLazyTest.testIndexFormulaMap
- org.hibernate.test.filter.DynamicFilterTest.testSecondLevelCachedCollectionsFiltering
- org.hibernate.test.filter.DynamicFilterTest.testCombinedClassAndCollectionFiltersEnabled
- org.hibernate.test.filter.DynamicFilterTest.testHqlFilters
- org.hibernate.test.filter.DynamicFilterTest.testCriteriaQueryFilters
- org.hibernate.test.filter.DynamicFilterTest.testGetFilters
- org.hibernate.test.filter.DynamicFilterTest.testOneToManyFilters
- org.hibernate.test.filter.DynamicFilterTest.testInStyleFilterParameter
- org.hibernate.test.filter.DynamicFilterTest.testManyToManyFilterOnCriteria
- org.hibernate.test.filter.DynamicFilterTest.testManyToManyFilterOnLoad
- org.hibernate.test.filter.DynamicFilterTest.testManyToManyOnCollectionLoadAfterHQL
- org.hibernate.test.filter.DynamicFilterTest.testManyToManyFilterOnQuery
- org.hibernate.test.filter.DynamicFilterTest.testManyToManyBaseThruCriteria
- org.hibernate.test.hql.ASTParserLoadingTest.testImplicitJoinsInDifferentClauses
- org.hibernate.test.hql.ASTParserLoadingTest.testImplicitSelectEntityAssociationInShallowQuery
- org.hibernate.test.hql.ASTParserLoadingTest.testAnyMappingReference
- org.hibernate.test.hql.ASTParserLoadingTest.testCollectionFetchWithDistinctionAndLimit
- org.hibernate.test.hql.ASTParserLoadingTest.testSuperclassPropertyReferenceAfterCollectionIndexedAccess
- org.hibernate.test.hql.ASTParserLoadingTest.testSelectClauseImplicitJoin
- org.hibernate.test.hql.ASTParserLoadingTest.testSelectClauseImplicitJoinWithIterate
- org.hibernate.test.hql.ASTParserLoadingTest.testAliases
- org.hibernate.test.hql.ASTParserLoadingTest.testManyToManyFilter
- org.hibernate.test.hql.ASTParserLoadingTest.testImplicitJoin
- org.hibernate.test.hql.BulkManipulationTest.testUpdateWithWhereExistsSubquery
- org.hibernate.test.hql.WithClauseTest.testWithClauseFailsWithFetch
- org.hibernate.test.hql.WithClauseTest.testWithClause
- org.hibernate.test.idbag.IdBagTest.testUpdateIdBag
- org.hibernate.test.idbag.IdBagTest.testJoin
- org.hibernate.test.interceptor.InterceptorTest.testCollectionIntercept
- org.hibernate.test.interceptor.InterceptorTest.testPropertyIntercept
- org.hibernate.test.joinfetch.JoinFetchTest.testCollectionFilter
- org.hibernate.test.joinfetch.JoinFetchTest.testJoinFetchManyToMany
- org.hibernate.test.legacy (about 145 cases)
- org.hibernate.test.manytomany.ManyToManyTest.testManyToManyWithFormula
- org.hibernate.test.map.MapIndexFormulaTest.testIndexFormulaMap
- org.hibernate.test.mapcompelem.MapCompositeElementTest.testMapCompositeElementWithFormula
- org.hibernate.test.mapcompelem.MapCompositeElementTest.testQueryMapCompositeElement
- org.hibernate.test.mapelemformula.MapElementFormulaTest.testManyToManyFormula
- org.hibernate.test.naturalid.mutable.MutableNaturalIdTest.testNaturalIdCheck
- org.hibernate.test.onetoone.link.OneToOneLinkTest.testOneToOneViaAssociationTable
- org.hibernate.test.ops.CreateTest.testBasic
- org.hibernate.test.ops.DeleteTest.testNoUpdateOnDeleteWithCollection
- org.hibernate.test.ops.MergeTest.testMergeBidiForeignKeyOneToOne
- org.hibernate.test.ops.MergeTest.testPersistThenMergeInSameTxnWithVersion
- org.hibernate.test.ops.MergeTest.testPersistThenMergeInSameTxnWithTimestamp
- org.hibernate.test.ops.MergeTest.testRecursiveMergeTransient
- org.hibernate.test.ops.MergeTest.testMergeManyToManyWithCollectionDeference
- org.hibernate.test.ordered.OrderByTest.testOrderBy
- org.hibernate.test.orphan.OrphanTest.testOrphanDeleteAfterPersist
- org.hibernate.test.propertyref.basic.PropertyRefTest.testManyToManyPropertyRef
- org.hibernate.test.proxy.ProxyTest.testProxyEviction
- org.hibernate.test.proxy.ProxyTest.testFullyLoadedPCSerialization
- org.hibernate.test.sorted.SortTest.testOrderBy
- org.hibernate.test.sql.hand.query.NativeSQLQueriesTest.testAutoDetectAliasing
- org.hibernate.test.stats.SessionStatsTest.testSessionStatistics
- org.hibernate.test.stats.StatsTest.testCollectionFetchVsLoad
- org.hibernate.test.subselectfetch.SubselectFetchTest.testSubselectFetchHql
- org.hibernate.test.subselectfetch.SubselectFetchTest.testSubselectFetchNamedParam
- org.hibernate.test.subselectfetch.SubselectFetchTest.testSubselectFetchPosParam
- org.hibernate.test.subselectfetch.SubselectFetchTest.testManyToManyCriteriaJoin
- org.hibernate.test.subselectfetch.SubselectFetchTest.testSubselectFetchCriteria
- org.hibernate.test.ternary.TernaryTest.testTernary
- org.hibernate.test.unionsubclass.UnionSubclassTest.testUnionSubclassOneToMany
- org.hibernate.test.unionsubclass.UnionSubclassTest.testUnionSubclassManyToOne
- org.hibernate.test.usercollection.basic.UserCollectionTypeTest.testBasicOperation
- org.hibernate.test.usercollection.parameterized.ParameterizedUserCollectionTypeTest.testBasicOperation












> Atomic remove + add of unique properties to a persistent set fails
> ------------------------------------------------------------------
>
>                 Key: HHH-2869
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2869
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.5
>         Environment: Hibernate 3.2.5 (2007.07.31);
> Oracle 9
>            Reporter: Pietu Pohjalainen
>            Priority: Minor
>         Attachments: hibernate-unique-showcase.zip
>
>
> Trying to remove and add equal objects to a persistent set with unique property on, fails.
> E.g. we have a set 'set' with one object, "X" contained in it. A sequence of
> set.clear();
> set.add("X");
> session.update(set);
> produces a unique constraint exception from the underlying database, because the update first tries to add the newly added objects, and only after that it tries to remove those.
> E.g. Oracle produces the following exception: "Caused by: java.sql.BatchUpdateException: ORA-00001: unique constraint (SHOWCASE.SYS_C0036053) violated"
> A workaround is would be to run the session.update(set); session.flush(); after clearing the set - but I would argue that interleaving the persistence-code with regular object handling code does not exactly fulfill the promise of 'transparent persistency'.
> Please see the attached showcase.zip, which sets up a database. There's a 'container', which contains a set of 'values', where values should be unique across all sets in the system. When trying to remove and add the same value to a set, the program throws an exception.
> The showcase driver script is located in class hibernate.Showcase. The object model classes are located in test.Container and test.Value.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list