-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: @Version, Flush(), Collections - Hibernate bug?
PostPosted: Wed Dec 20, 2006 9:37 am 
Newbie

Joined: Fri Oct 27, 2006 8:43 am
Posts: 14
I'm terribly sorry for posting this question again, but my other was ignored... :-(

n our system here, which has several entities and relationships, everything was running fine (unit tests, etc.). We are using the following hibernate versions:

Hibernate Core 3.2.0.cr4
Hibernate Annotations 3.2.0.cr2
Hibernate EntityManager 3.2.0.cr2

But i also tested in:

Hibernate Core 3.2.1.GA
Hibernate Annotations 3.2.0.GA
Hibernate EntityManager 3.2.1.GA


We are using annotations for everything, including validation.

We then tried to use Hibernate @Version annotation to control concurrency. Everything was working fine, and right after i insert this annotation in the proper field, many of my unit tests start accusing this error, in unused collections:

org.hibernate.AssertionFailure: collection [...] was not processed by flush()

We are not using any custom listeners. On the internet, i checked that custom listeners may cause this trouble, but in our case we only need to put versioning for it to happen.

---

I found a way for this error not to happen, but it is not a desirable way:

Entities X and Y have a bidirectional many-to-many relation. If i use @Version, when testing X i get "collection Y.x was not processed by flush()". But if i set the Fetch Type in collection X.y to EAGER, this error does not happen.

Why doesn't it work with lazy? Is it a hibernate bug?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 30, 2007 7:40 am 
Newbie

Joined: Fri Oct 27, 2006 8:43 am
Posts: 14
I still have the same problem... :-(


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 23, 2007 11:52 am 
Beginner
Beginner

Joined: Mon Sep 12, 2005 3:27 am
Posts: 48
I really have the same problem !

we have m : n relationship with between USER and GROUP, as also 1 : n between GROUP and PERMISSION.
If we update Group or Permissions, it throws an assertionfailure for collection USER.groups.

Code:
org.hibernate.AssertionFailure: collection [com.qualitype.lims.server.core.ejb.entity.user.UserEntity.groups] was not processed by flush()
   at org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:205)
   at org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:333)


These error occures really only in following constellation: ManyToMany + @Version-Column + Flush-Event.

Seems really like a hibernate-bug.[/code]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.