Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Alana Sparx
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

I've been getting the above error no matter what I try and do to solve it.

THe collection in question is

I've removed the xdoclet tag from the collection heading.
I've overridden the compateTo method to check for
I've used the latest version of hibernate (3.2.5.ga) and still I get the same exception thrown!

PolicyStatusRestriction does not contain any sets. Both PolicyStatus and PolicyStatusRestriction are immutable.

Any ideas? THe full stacktrace follows:
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, it appears you have closed your Session.

I have a couple of questions.

1. Why are you using xdoclet. You are using Hibernate 3.2 which can use Annotations or hbm files, I suggest using one or the other. I don't believe xdoclet makes hbm files that are 3.2 compliant, unless they have been updated recently.

Ok just one question.

Mark
 
Alana Sparx
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark, tanks for the reply.

Well, it appears you have closed your Session.

I don't think that was the issue. I set the xdoclet 'lazy="false"', which ceased reporting the session being closed, but the AssertionError is still being reported

I have a couple of questions.

1. Why are you using xdoclet. You are using Hibernate 3.2

Only because we were previously using version 3.0.?.ga, and upgrading to 3.2.5 was in response to the error above ie no time to refactor the xdoclets (Hibernate site suggested it was an error fixed in 3.2.1 Further investigations suggest it is still a problem, as yet unresolved as reported here)

I don't think the xdoclets would affect the application in this way. The error above, for the project I'm working on, is a bit of a showstopper, so I'm in a bit of a 'brown trouser' situation at the moment.

Any other ideas?
 
Alana Sparx
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again

Here is an interim solution for anyone else who comes across this situation.

Note that the collection I'm dealing with is immutable, if yours isn't, I'm not sure what the consequences of this would be.

We augmented the Hibernate class CollectionEntry from

to


Basically, we check for the specific collection name that was causing us grief, if the collection isn't this, Hibernate carries on as usual. If the collection is our own specific one, don't bother with the flush.

loadedPersister has a mutable flag on it, wasn't sure if checking this flag and evading postFlush() is an appropriate thing to do or not, probably a question that can best be answered by the Hibernators
 
Faissal Lauar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Alana,

I considered your solution and I thought of, in this case, a simpler way to do the same thing.

I just added a @Transient annotation on top of the property that contains the @OneToMany(mappedby= ...

If your framework supports that annotation and you use it, this property won't be flushed anyway...

Best regards,




Alana Sparx wrote:Hi again

Here is an interim solution for anyone else who comes across this situation.

Note that the collection I'm dealing with is immutable, if yours isn't, I'm not sure what the consequences of this would be.

We augmented the Hibernate class CollectionEntry from

to


Basically, we check for the specific collection name that was causing us grief, if the collection isn't this, Hibernate carries on as usual. If the collection is our own specific one, don't bother with the flush.

loadedPersister has a mutable flag on it, wasn't sure if checking this flag and evading postFlush() is an appropriate thing to do or not, probably a question that can best be answered by the Hibernators
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic