Upgraded to 1.1.2 --> StackOverflowError when calling findBy inside validator closure

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Upgraded to 1.1.2 --> StackOverflowError when calling findBy inside validator closure

Nicolás Dijkstra
Hello, 

i'm getting a StackOverflowError since i upgraded to Grails 1.1.2 when i call a dynamic finder inside  a domain object property validator closure. Here's a sample code:

class Employee {
    String firstName
    String lastName
    String govId

    static constraints = {
        firstName(nullable: false, blank: false)
        lastName(nullable: false, blank: false)
        govId(nullable: false, blank: false, validator: {val, obj ->
            if (val != null) {
                def find = Employee.withCriteria {
                    and {
                        if (obj.id) {
                            not {
                                idEq(obj.id)
                            }
                        }
                        like('govId', val)
                    }
                }
                return find.isEmpty() ? true : 'unique'
            } else {
                return true
            }
        }
        )
    }
}

After a quick debugging, i found the validator was being called recursiverly. At the moment of writing this email i haven't found yet where the call to validate is being issued again and again.

Any help will be appreciated

Regards,
Nicolás
Reply | Threaded
Open this post in threaded view
|

Re: Upgraded to 1.1.2 --> StackOverflowError when calling findBy inside validator closure

Graeme Rocher-3
The reason for this is that the finder triggers a hibernate flush. A
way around this is to use the withSession method to set the flush mode
to manual so that changes aren't persisted when your constraint is
running:

Employee.withSession { session ->
       try {
            session.setFlushMode(FlushMode.MANUAL)
            // do stuff
       } finally {
            session.setFlushMode(FlushMode.AUTO)
       }
}

Cheers

2009/12/4 Nicolás Dijkstra <[hidden email]>:

> Hello,
> i'm getting a StackOverflowError since i upgraded to Grails 1.1.2 when i
> call a dynamic finder inside  a domain object property validator closure.
> Here's a sample code:
> class Employee {
>     String firstName
>     String lastName
>     String govId
>     static constraints = {
>         firstName(nullable: false, blank: false)
>         lastName(nullable: false, blank: false)
>         govId(nullable: false, blank: false, validator: {val, obj ->
>             if (val != null) {
>                 def find = Employee.withCriteria {
>                     and {
>                         if (obj.id) {
>                             not {
>                                 idEq(obj.id)
>                             }
>                         }
>                         like('govId', val)
>                     }
>                 }
>                 return find.isEmpty() ? true : 'unique'
>             } else {
>                 return true
>             }
>         }
>         )
>     }
> }
> After a quick debugging, i found the validator was being called
> recursiverly. At the moment of writing this email i haven't found yet where
> the call to validate is being issued again and again.
> Any help will be appreciated
> Regards,
> Nicolás



--
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


Reply | Threaded
Open this post in threaded view
|

Re: Upgraded to 1.1.2 --> StackOverflowError when calling findBy inside validator closure

Nicolás Dijkstra
Graeme, thank you very much for answering so quickly and above all thanks a lot because IT WORKED perfectly.

Regards,
Nicolás

On Fri, Dec 4, 2009 at 10:47 AM, Graeme Rocher <[hidden email]> wrote:
The reason for this is that the finder triggers a hibernate flush. A
way around this is to use the withSession method to set the flush mode
to manual so that changes aren't persisted when your constraint is
running:

Employee.withSession { session ->
      try {
           session.setFlushMode(FlushMode.MANUAL)
           // do stuff
      } finally {
           session.setFlushMode(FlushMode.AUTO)
      }
}

Cheers

2009/12/4 Nicolás Dijkstra <[hidden email]>:
> Hello,
> i'm getting a StackOverflowError since i upgraded to Grails 1.1.2 when i
> call a dynamic finder inside  a domain object property validator closure.
> Here's a sample code:
> class Employee {
>     String firstName
>     String lastName
>     String govId
>     static constraints = {
>         firstName(nullable: false, blank: false)
>         lastName(nullable: false, blank: false)
>         govId(nullable: false, blank: false, validator: {val, obj ->
>             if (val != null) {
>                 def find = Employee.withCriteria {
>                     and {
>                         if (obj.id) {
>                             not {
>                                 idEq(obj.id)
>                             }
>                         }
>                         like('govId', val)
>                     }
>                 }
>                 return find.isEmpty() ? true : 'unique'
>             } else {
>                 return true
>             }
>         }
>         )
>     }
> }
> After a quick debugging, i found the validator was being called
> recursiverly. At the moment of writing this email i haven't found yet where
> the call to validate is being issued again and again.
> Any help will be appreciated
> Regards,
> Nicolás



--
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



Reply | Threaded
Open this post in threaded view
|

RE: Re: Upgraded to 1.1.2 --> StackOverflowError when calling findBy inside validator closure

okomba@yahoo.com
In reply to this post by Graeme Rocher-3
Hi,

Does this mean that upgrading to 1.1.2 means re-doing all persistence methods?

I am a bit ignorant here, but why would flush AUTO mode trigger a StackOveFlow?

Thanks.

Mugoma,
Yengas.




Graeme Rocher wrote:

> The reason for this is that the finder triggers a hibernate flush. A
> way around this is to use the withSession method to set the flush mode
> to manual so that changes aren't persisted when your constraint is
> running:
> Employee.withSession { session ->
>        try {
>             session.setFlushMode(FlushMode.MANUAL)
>             // do stuff
>        } finally {
>             session.setFlushMode(FlushMode.AUTO)
>        }
> }
> Cheers
> 2009/12/4 Nicolás Dijkstra <[hidden email]>:
>> Hello,
>> i'm getting a StackOverflowError since i upgraded to Grails 1.1.2 when i
>> call a dynamic finder inside  a domain object property validator closure.
>> Here's a sample code:
>> class Employee {
>>     String firstName
>>     String lastName
>>     String govId
>>     static constraints = {
>>         firstName(nullable: false, blank: false)
>>         lastName(nullable: false, blank: false)
>>         govId(nullable: false, blank: false, validator: {val, obj ->
>>             if (val != null) {
>>                 def find = Employee.withCriteria {
>>                     and {
>>                         if (obj.id) {
>>                             not {
>>                                 idEq(obj.id)
>>                             }
>>                         }
>>                         like('govId', val)
>>                     }
>>                 }
>>                 return find.isEmpty() ? true : 'unique'
>>             } else {
>>                 return true
>>             }
>>         }
>>         )
>>     }
>> }
>> After a quick debugging, i found the validator was being called
>> recursiverly. At the moment of writing this email i haven't found yet where
>> the call to validate is being issued again and again.
>> Any help will be appreciated
>> Regards,
>> Nicolás
> --
> 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


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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Re: Upgraded to 1.1.2 --> StackOverflowError when calling findBy inside validator closure

Nicolás Dijkstra
It means that if you're going to do call a find method from inside a custom validator, you should dissable autoflushing because the finder tries to flush the session, triggering a validation and so on ... it loops 'till the stack overflows.

There's a sample code in my first message.

Regards,
Nicolás

On Fri, Dec 4, 2009 at 2:20 PM, [hidden email] <[hidden email]> wrote:
Hi,

Does this mean that upgrading to 1.1.2 means re-doing all persistence methods?

I am a bit ignorant here, but why would flush AUTO mode trigger a StackOveFlow?

Thanks.

Mugoma,
Yengas.




Graeme Rocher wrote:
> The reason for this is that the finder triggers a hibernate flush. A
> way around this is to use the withSession method to set the flush mode
> to manual so that changes aren't persisted when your constraint is
> running:
> Employee.withSession { session ->
>        try {
>             session.setFlushMode(FlushMode.MANUAL)
>             // do stuff
>        } finally {
>             session.setFlushMode(FlushMode.AUTO)
>        }
> }
> Cheers
> 2009/12/4 Nicolás Dijkstra <[hidden email]>:
>> Hello,
>> i'm getting a StackOverflowError since i upgraded to Grails 1.1.2 when i
>> call a dynamic finder inside  a domain object property validator closure.
>> Here's a sample code:
>> class Employee {
>>     String firstName
>>     String lastName
>>     String govId
>>     static constraints = {
>>         firstName(nullable: false, blank: false)
>>         lastName(nullable: false, blank: false)
>>         govId(nullable: false, blank: false, validator: {val, obj ->
>>             if (val != null) {
>>                 def find = Employee.withCriteria {
>>                     and {
>>                         if (obj.id) {
>>                             not {
>>                                 idEq(obj.id)
>>                             }
>>                         }
>>                         like('govId', val)
>>                     }
>>                 }
>>                 return find.isEmpty() ? true : 'unique'
>>             } else {
>>                 return true
>>             }
>>         }
>>         )
>>     }
>> }
>> After a quick debugging, i found the validator was being called
>> recursiverly. At the moment of writing this email i haven't found yet where
>> the call to validate is being issued again and again.
>> Any help will be appreciated
>> Regards,
>> Nicolás
> --
> 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


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

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

RE: Re: Re: Upgraded to 1.1.2 --> StackOverflowError when calling findBy inside validator closure

okomba@yahoo.com
Alright. So it applies only to situations where you have a custom validitor?

Thanks.

Mugoma,
Yengas.



Nicolás Dijkstra wrote:

> It means that if you're going to do call a find method from inside a custom validator, you should dissable autoflushing because the finder tries to flush the session, triggering a validation and so on ... it loops 'till the stack overflows.
>  There's a sample code in my first message. Regards, Nicolás On Fri, Dec 4, 2009 at 2:20 PM, [hidden email] < [hidden email] > wrote:
>  Hi,
> Does this mean that upgrading to 1.1.2 means re-doing all persistence methods?
> I am a bit ignorant here, but why would flush AUTO mode trigger a StackOveFlow?
> Thanks.
> Mugoma,
> Yengas.
> Graeme Rocher wrote:
>> The reason for this is that the finder triggers a hibernate flush. A
>> way around this is to use the withSession method to set the flush mode
>> to manual so that changes aren't persisted when your constraint is
>> running:
>> Employee.withSession { session ->
>>        try {
>>             session.setFlushMode(FlushMode.MANUAL)
>>             // do stuff
>>        } finally {
>>             session.setFlushMode(FlushMode.AUTO)
>>        }
>> }
>> Cheers
>> 2009/12/4 Nicolás Dijkstra < [hidden email] >:
>>> Hello,
>>> i'm getting a StackOverflowError since i upgraded to Grails 1.1.2 when i
>>> call a dynamic finder inside  a domain object property validator closure.
>>> Here's a sample code:
>>> class Employee {
>>>     String firstName
>>>     String lastName
>>>     String govId
>>>     static constraints = {
>>>         firstName(nullable: false, blank: false)
>>>         lastName(nullable: false, blank: false)
>>>         govId(nullable: false, blank: false, validator: {val, obj ->
>>>             if (val != null) {
>>>                 def find = Employee.withCriteria {
>>>                     and {
>>>                         if ( obj.id ) {
>>>                             not {
>>>                                 idEq( obj.id )
>>>                             }
>>>                         }
>>>                         like('govId', val)
>>>                     }
>>>                 }
>>>                 return find.isEmpty() ? true : 'unique'
>>>             } else {
>>>                 return true
>>>             }
>>>         }
>>>         )
>>>     }
>>> }
>>> After a quick debugging, i found the validator was being called
>>> recursiverly. At the moment of writing this email i haven't found yet where
>>> the call to validate is being issued again and again.
>>> Any help will be appreciated
>>> Regards,
>>> Nicolás
>> --
>> 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 
> ---------------------------------------------------------------------
> 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


Reply | Threaded
Open this post in threaded view
|

RE: Re: Re: Upgraded to 1.1.2 --> StackOverflowError when calling findBy inside validator closure

okomba@yahoo.com
In reply to this post by Nicolás Dijkstra
Alright. So it applies only to situations where you have a custom validitor?

Thanks.

Mugoma,
Yengas.



Nicolás Dijkstra wrote:

> It means that if you're going to do call a find method from inside a custom validator, you should dissable autoflushing because the finder tries to flush the session, triggering a validation and so on ... it loops 'till the stack overflows.
>  There's a sample code in my first message. Regards, Nicolás On Fri, Dec 4, 2009 at 2:20 PM, [hidden email] < [hidden email] > wrote:
>  Hi,
> Does this mean that upgrading to 1.1.2 means re-doing all persistence methods?
> I am a bit ignorant here, but why would flush AUTO mode trigger a StackOveFlow?
> Thanks.
> Mugoma,
> Yengas.
> Graeme Rocher wrote:
>> The reason for this is that the finder triggers a hibernate flush. A
>> way around this is to use the withSession method to set the flush mode
>> to manual so that changes aren't persisted when your constraint is
>> running:
>> Employee.withSession { session ->
>>        try {
>>             session.setFlushMode(FlushMode.MANUAL)
>>             // do stuff
>>        } finally {
>>             session.setFlushMode(FlushMode.AUTO)
>>        }
>> }
>> Cheers
>> 2009/12/4 Nicolás Dijkstra < [hidden email] >:
>>> Hello,
>>> i'm getting a StackOverflowError since i upgraded to Grails 1.1.2 when i
>>> call a dynamic finder inside  a domain object property validator closure.
>>> Here's a sample code:
>>> class Employee {
>>>     String firstName
>>>     String lastName
>>>     String govId
>>>     static constraints = {
>>>         firstName(nullable: false, blank: false)
>>>         lastName(nullable: false, blank: false)
>>>         govId(nullable: false, blank: false, validator: {val, obj ->
>>>             if (val != null) {
>>>                 def find = Employee.withCriteria {
>>>                     and {
>>>                         if ( obj.id ) {
>>>                             not {
>>>                                 idEq( obj.id )
>>>                             }
>>>                         }
>>>                         like('govId', val)
>>>                     }
>>>                 }
>>>                 return find.isEmpty() ? true : 'unique'
>>>             } else {
>>>                 return true
>>>             }
>>>         }
>>>         )
>>>     }
>>> }
>>> After a quick debugging, i found the validator was being called
>>> recursiverly. At the moment of writing this email i haven't found yet where
>>> the call to validate is being issued again and again.
>>> Any help will be appreciated
>>> Regards,
>>> Nicolás
>> --
>> 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 
> ---------------------------------------------------------------------
> 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


Reply | Threaded
Open this post in threaded view
|

RE: Re: Re: Upgraded to 1.1.2 --> StackOverflowError when calling findBy inside validator closure

okomba@yahoo.com
In reply to this post by Nicolás Dijkstra
Alright. So it applies only to situations where you have a custom validitor?

Thanks.

Mugoma,
Yengas.



Nicolás Dijkstra wrote:

> It means that if you're going to do call a find method from inside a custom validator, you should dissable autoflushing because the finder tries to flush the session, triggering a validation and so on ... it loops 'till the stack overflows.
>  There's a sample code in my first message. Regards, Nicolás On Fri, Dec 4, 2009 at 2:20 PM, [hidden email] < [hidden email] > wrote:
>  Hi,
> Does this mean that upgrading to 1.1.2 means re-doing all persistence methods?
> I am a bit ignorant here, but why would flush AUTO mode trigger a StackOveFlow?
> Thanks.
> Mugoma,
> Yengas.
> Graeme Rocher wrote:
>> The reason for this is that the finder triggers a hibernate flush. A
>> way around this is to use the withSession method to set the flush mode
>> to manual so that changes aren't persisted when your constraint is
>> running:
>> Employee.withSession { session ->
>>        try {
>>             session.setFlushMode(FlushMode.MANUAL)
>>             // do stuff
>>        } finally {
>>             session.setFlushMode(FlushMode.AUTO)
>>        }
>> }
>> Cheers
>> 2009/12/4 Nicolás Dijkstra < [hidden email] >:
>>> Hello,
>>> i'm getting a StackOverflowError since i upgraded to Grails 1.1.2 when i
>>> call a dynamic finder inside  a domain object property validator closure.
>>> Here's a sample code:
>>> class Employee {
>>>     String firstName
>>>     String lastName
>>>     String govId
>>>     static constraints = {
>>>         firstName(nullable: false, blank: false)
>>>         lastName(nullable: false, blank: false)
>>>         govId(nullable: false, blank: false, validator: {val, obj ->
>>>             if (val != null) {
>>>                 def find = Employee.withCriteria {
>>>                     and {
>>>                         if ( obj.id ) {
>>>                             not {
>>>                                 idEq( obj.id )
>>>                             }
>>>                         }
>>>                         like('govId', val)
>>>                     }
>>>                 }
>>>                 return find.isEmpty() ? true : 'unique'
>>>             } else {
>>>                 return true
>>>             }
>>>         }
>>>         )
>>>     }
>>> }
>>> After a quick debugging, i found the validator was being called
>>> recursiverly. At the moment of writing this email i haven't found yet where
>>> the call to validate is being issued again and again.
>>> Any help will be appreciated
>>> Regards,
>>> Nicolás
>> --
>> 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 
> ---------------------------------------------------------------------
> 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


Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Upgraded to 1.1.2 --> StackOverflowError when calling findBy inside validator closure

Nicolás Dijkstra
In reply to this post by okomba@yahoo.com
The one stated in the former emails is one situation where it is sure to happen. I can't tell if it's the only one.

Anyway, i think there was no need in spamming the users list with the same question every 5 minutes.

2009/12/4 [hidden email] <[hidden email]>
Alright. So it applies only to situations where you have a custom validitor?

Thanks.

Mugoma,
Yengas.



Nicolás Dijkstra wrote:
> It means that if you're going to do call a find method from inside a custom validator, you should dissable autoflushing because the finder tries to flush the session, triggering a validation and so on ... it loops 'till the stack overflows.
>  There's a sample code in my first message. Regards, Nicolás On Fri, Dec 4, 2009 at 2:20 PM, [hidden email] < [hidden email] > wrote:
>  Hi,
> Does this mean that upgrading to 1.1.2 means re-doing all persistence methods?
> I am a bit ignorant here, but why would flush AUTO mode trigger a StackOveFlow?
> Thanks.
> Mugoma,
> Yengas.
> Graeme Rocher wrote:
>> The reason for this is that the finder triggers a hibernate flush. A
>> way around this is to use the withSession method to set the flush mode
>> to manual so that changes aren't persisted when your constraint is
>> running:
>> Employee.withSession { session ->
>>        try {
>>             session.setFlushMode(FlushMode.MANUAL)
>>             // do stuff
>>        } finally {
>>             session.setFlushMode(FlushMode.AUTO)
>>        }
>> }
>> Cheers
>> 2009/12/4 Nicolás Dijkstra < [hidden email] >:
>>> Hello,
>>> i'm getting a StackOverflowError since i upgraded to Grails 1.1.2 when i
>>> call a dynamic finder inside  a domain object property validator closure.
>>> Here's a sample code:
>>> class Employee {
>>>     String firstName
>>>     String lastName
>>>     String govId
>>>     static constraints = {
>>>         firstName(nullable: false, blank: false)
>>>         lastName(nullable: false, blank: false)
>>>         govId(nullable: false, blank: false, validator: {val, obj ->
>>>             if (val != null) {
>>>                 def find = Employee.withCriteria {
>>>                     and {
>>>                         if ( obj.id ) {
>>>                             not {
>>>                                 idEq( obj.id )
>>>                             }
>>>                         }
>>>                         like('govId', val)
>>>                     }
>>>                 }
>>>                 return find.isEmpty() ? true : 'unique'
>>>             } else {
>>>                 return true
>>>             }
>>>         }
>>>         )
>>>     }
>>> }
>>> After a quick debugging, i found the validator was being called
>>> recursiverly. At the moment of writing this email i haven't found yet where
>>> the call to validate is being issued again and again.
>>> Any help will be appreciated
>>> Regards,
>>> Nicolás
>> --
>> 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
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>      http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

RE: Re: Re: Re: Upgraded to 1.1.2 --> StackOverflowError when calling findBy inside validator closure

okomba@yahoo.com
No spam intended. I didn't know it had gone out during first two trials. Sorry about that.



Nicolás Dijkstra wrote:

> The one stated in the former emails is one situation where it is sure to happen. I can't tell if it's the only one. Anyway, i think there was no need in spamming the users list with the same question every 5 minutes.
>  2009/12/4 [hidden email] < [hidden email] >
> Alright. So it applies only to situations where you have a custom validitor?
> Thanks.
> Mugoma,
> Yengas.
> Nicolás Dijkstra wrote:
>> It means that if you're going to do call a find method from inside a custom validator, you should dissable autoflushing because the finder tries to flush the session, triggering a validation and so on ... it loops 'till the stack overflows.
>>  There's a sample code in my first message. Regards, Nicolás On Fri, Dec 4, 2009 at 2:20 PM, [hidden email] < [hidden email] > wrote:
>>  Hi,
>> Does this mean that upgrading to 1.1.2 means re-doing all persistence methods?
>> I am a bit ignorant here, but why would flush AUTO mode trigger a StackOveFlow?
>> Thanks.
>> Mugoma,
>> Yengas.
>> Graeme Rocher wrote:
>>> The reason for this is that the finder triggers a hibernate flush. A
>>> way around this is to use the withSession method to set the flush mode
>>> to manual so that changes aren't persisted when your constraint is
>>> running:
>>> Employee.withSession { session ->
>>>        try {
>>>             session.setFlushMode(FlushMode.MANUAL)
>>>             // do stuff
>>>        } finally {
>>>             session.setFlushMode(FlushMode.AUTO)
>>>        }
>>> }
>>> Cheers
>>> 2009/12/4 Nicolás Dijkstra < [hidden email] >:
>>>> Hello,
>>>> i'm getting a StackOverflowError since i upgraded to Grails 1.1.2 when i
>>>> call a dynamic finder inside  a domain object property validator closure.
>>>> Here's a sample code:
>>>> class Employee {
>>>>     String firstName
>>>>     String lastName
>>>>     String govId
>>>>     static constraints = {
>>>>         firstName(nullable: false, blank: false)
>>>>         lastName(nullable: false, blank: false)
>>>>         govId(nullable: false, blank: false, validator: {val, obj ->
>>>>             if (val != null) {
>>>>                 def find = Employee.withCriteria {
>>>>                     and {
>>>>                         if ( obj.id ) {
>>>>                             not {
>>>>                                 idEq( obj.id )
>>>>                             }
>>>>                         }
>>>>                         like('govId', val)
>>>>                     }
>>>>                 }
>>>>                 return find.isEmpty() ? true : 'unique'
>>>>             } else {
>>>>                 return true
>>>>             }
>>>>         }
>>>>         )
>>>>     }
>>>> }
>>>> After a quick debugging, i found the validator was being called
>>>> recursiverly. At the moment of writing this email i haven't found yet where
>>>> the call to validate is being issued again and again.
>>>> Any help will be appreciated
>>>> Regards,
>>>> Nicolás
>>> --
>>> 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 
>> ---------------------------------------------------------------------
>> 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