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

View: New views
9 Messages — Rating Filter:   Alert me  

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

by Mugoma Joseph Okomba-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

When trying to save an object I am getting following error:

Error 500: org.hibernate.AssertionFailure: collection [org.app.settings.country.model.Country.cities] was not processed by flush()

where Country has:

    static hasMany = [cities: City, provinces: Province, districts: District]

Sometimes error message shows Country.provinces and other times it shows Country.districts.

I thought the error is being caused by searchable plugin (as per the thread http://www.nabble.com/Collection-not-processed-by-flush--td15887577.html) but uninstalling searchable didn't solve the problem.

Any idea?

Thanks.

Mugoma,
Yengas.





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



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

by Mugoma Joseph Okomba-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am still stuck on this error. Anybody with a clue?

Thanks.

Mugoma,
Yengas.



--- On Sun, 10/4/09, Mugoma Joseph Okomba <okomba@...> wrote:

> From: Mugoma Joseph Okomba <okomba@...>
> Subject: [grails-user] org.hibernate.AssertionFailure: collection was not processed by flush()
> To: "grails user" <user@...>
> Date: Sunday, October 4, 2009, 5:51 PM
> Hi all,
>
> When trying to save an object I am getting following
> error:
>
> Error 500: org.hibernate.AssertionFailure: collection
> [org.app.settings.country.model.Country.cities] was not
> processed by flush()
>
> where Country has:
>
>     static hasMany = [cities: City, provinces:
> Province, districts: District]
>
> Sometimes error message shows Country.provinces and other
> times it shows Country.districts.
>
> I thought the error is being caused by searchable plugin
> (as per the thread http://www.nabble.com/Collection-not-processed-by-flush--td15887577.html)
> but uninstalling searchable didn't solve the problem.
>
> Any idea?
>
> Thanks.
>
> Mugoma,
> Yengas.
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



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

by shrestha :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

by Daniel Honig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

First thing to do when troubleshooting is to make sure that all of your objects in the graph validate successfully when saving.

You might try posting the code that you are using to save the objects as the order of operations and what you call them on is important.


On Sun, Oct 4, 2009 at 9:51 AM, Mugoma Joseph Okomba <okomba@...> wrote:
Hi all,

When trying to save an object I am getting following error:

Error 500: org.hibernate.AssertionFailure: collection [org.app.settings.country.model.Country.cities] was not processed by flush()

where Country has:

   static hasMany = [cities: City, provinces: Province, districts: District]

Sometimes error message shows Country.provinces and other times it shows Country.districts.

I thought the error is being caused by searchable plugin (as per the thread http://www.nabble.com/Collection-not-processed-by-flush--td15887577.html) but uninstalling searchable didn't solve the problem.

Any idea?

Thanks.

Mugoma,
Yengas.





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




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

by mjfan80 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

i've upgrated to grails 1.2M3
but i have this problem

the jra is closed http://jira.codehaus.org/browse/GRAILS-4453
and is indicated that is solved in grails 1.2M2


but i have grails 1.2m3 and the bug is still here

Please... i'm stucked

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

by mjfan80 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

i tryed many think now
but i'm still blocked on this issue

please, really, can anyone help me?
mjfan80 wrote:
i've upgrated to grails 1.2M3
but i have this problem

the jra is closed http://jira.codehaus.org/browse/GRAILS-4453
and is indicated that is solved in grails 1.2M2


but i have grails 1.2m3 and the bug is still here

Please... i'm stucked

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

by Graeme Rocher-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Raise an issue, attach an example that reproduces the issue. Most
likely though you're doing something in an event that hibernate
doesn't like and you should wrap your event logic in a new session
like:

def afterInsert() {
     Foo.withNewSession {
          // do stuff
     }
}

On Thu, Nov 5, 2009 at 5:57 PM, mjfan80 <mjfan80@...> wrote:

>
> i tryed many think now
> but i'm still blocked on this issue
>
> please, really, can anyone help me?
>
> mjfan80 wrote:
>>
>> i've upgrated to grails 1.2M3
>> but i have this problem
>>
>> the jra is closed http://jira.codehaus.org/browse/GRAILS-4453
>> and is indicated that is solved in grails 1.2M2
>>
>>
>> but i have grails 1.2m3 and the bug is still here
>>
>> Please... i'm stucked
>>
>
> --
> View this message in context: http://old.nabble.com/org.hibernate.AssertionFailure%3A-collection-was-not-processed-by-flush%28%29-tp25738257p26215806.html
> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>



--
Graeme Rocher
Head of Grails Development
SpringSource - A Division of VMware
http://www.springsource.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



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

by BluSynergy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There is not enough info to help you. As previously mentioned, post the code snippet that shows how you are populating and saving the hasMany collection.

Some approaches to consider:
Option 1: country.addToCities(name:"NY", ...).save() // performance impact if adding large # of cities

Option 2:
us = Country.get(111)
new City(country:us, name:"NY", ...).save() // assumes City has a belongsTo = country

Option 2 is less likely to be problematic, but may not fit "nicely" with the logic you are trying to implement
HTH
Sunny Thandassery
http://www.BluSynergy.com
Solutions for Subscription Billing and Payment Processing

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

by mjfan80 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Tryng to do some test, i just delete the "flush:true" and everything now is working

the way i'm doing the relation is something like that


def chiamata = Chiamata.get('2009/0005/C') (they have a string id)

chiamata.impianto = Impianto.get(5)

chiamata.save()