]
Hardy Ferentschik updated HV-37:
--------------------------------
Component/s: (was: engine)
legacy
Moved issue into legacy component. This issue applies to codebase prior 4.x
Validating a lazy collection of composite-elements causes flush
problem
------------------------------------------------------------------------
Key: HV-37
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HV-37
Project: Hibernate Validator
Issue Type: Bug
Components: legacy
Affects Versions: 3.0.0.ga
Environment: Hibernate 3.2.4ga
Hibernate Annotations 3.3.0.ga
mysql 5.0.27
Reporter: Ian Long
Using the event listeners(pre-update,pre-insert) in hibernate, a problem occurs when
validating a lazy collection of composite-elements.
I was using the @Size validator, but I'm sure others will cause the same problem.
For example:
<set name="activatedModules"
lazy="true"
table="location_module_activation">
<key column="location_id" />
<composite-element
class="com.opterus.opscenter.model.module.ActivatedModule" >
<property name="activationDate"
column="activate_date" not-null="true" />
<many-to-one name="module"
class="com.opterus.opscenter.model.module.Module" column="module_id"
not-null="true" unique="false" />
</composite-element>
</set>
will cause an exception during flush:
01:53:55,587 ERROR [http-8080-Processor23] AssertionFailure:22 - an assertion failure
occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the
session)
org.hibernate.AssertionFailure: collection
[com.opterus.opscenter.model.common.Brand.regions] was not processed by flush()
at org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:205)
at
org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:333)
at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:28)
Since it tries to access the proxied collection. A collection of entity objects does not
cause this problem.
I guess the composite-element is handled differently than regular collections?
Filed at the request of emmanuel, from the following thread:
http://forum.hibernate.org/viewtopic.php?p=2361829#2361829
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: