Application Reloading in Grails

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Application Reloading in Grails

graemer
Hi all,

Thanks to the magic of Jochen's changes in the Groovy class loader
Grails applications can now be reloaded on the fly!

There are some quirks (I havn't figured out a way to reload
transactional service classes) but on a whole it works well and is
pretty fast. Particularily cool is when you have Hibernate
automatically creating your schema with ddl auto you can update a
domain class, refresh and the db schema will automatically be updated
:-)

Anyway a step in the right direction for Grails

Graeme
Reply | Threaded
Open this post in threaded view
|

RE: Application Reloading in Grails

Dierk König
cool ! Congratulations ! That's a killer feature !

The reload is triggered by automatically by file changes, or
is there some special Controller to invoke?

cheers
Mittie

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]On Behalf
> Of Graeme Rocher
> Sent: Donnerstag, 2. Februar 2006 11:38
> To: [hidden email]
> Subject: [grails-dev] Application Reloading in Grails
>
>
> Hi all,
>
> Thanks to the magic of Jochen's changes in the Groovy class loader
> Grails applications can now be reloaded on the fly!
>
> There are some quirks (I havn't figured out a way to reload
> transactional service classes) but on a whole it works well and is
> pretty fast. Particularily cool is when you have Hibernate
> automatically creating your schema with ddl auto you can update a
> domain class, refresh and the db schema will automatically be updated
> :-)
>
> Anyway a step in the right direction for Grails
>
> Graeme
Reply | Threaded
Open this post in threaded view
|

Re: Application Reloading in Grails

graemer
On 02/02/06, Dierk Koenig <[hidden email]> wrote:
> cool ! Congratulations ! That's a killer feature !
>
> The reload is triggered by automatically by file changes, or
> is there some special Controller to invoke?

Automatically triggered by file changes. There is a filter that
detects file changes in the sources files when you do the "grails
run-app" command reloads the necessary class performing the necessary
action (re-mapping the domain classes for example)

Graeme

>
> cheers
> Mittie
>
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]]On Behalf
> > Of Graeme Rocher
> > Sent: Donnerstag, 2. Februar 2006 11:38
> > To: [hidden email]
> > Subject: [grails-dev] Application Reloading in Grails
> >
> >
> > Hi all,
> >
> > Thanks to the magic of Jochen's changes in the Groovy class loader
> > Grails applications can now be reloaded on the fly!
> >
> > There are some quirks (I havn't figured out a way to reload
> > transactional service classes) but on a whole it works well and is
> > pretty fast. Particularily cool is when you have Hibernate
> > automatically creating your schema with ddl auto you can update a
> > domain class, refresh and the db schema will automatically be updated
> > :-)
> >
> > Anyway a step in the right direction for Grails
> >
> > Graeme
>
Reply | Threaded
Open this post in threaded view
|

Re: Application Reloading in Grails

Burkard Endres
i found a problem on unix systems with classloading and reloading in grails
in GrailsResourceHolder and in GrailsResourceHolder there is a Regular
Expression compiled that fits
only windows systems.
on my iMac it doesnt work. I changed it to
    public static Pattern GRAILS_RESOURCE_PATTERN =
Pattern.compile(".+\\\\grails-app\\\\\\w+\\\\(.+)\\.groovy");
    static{
            if(File.separator.equals("/")){
                GRAILS_RESOURCE_PATTERN =
Pattern.compile(".+/grails-app/\\w+/(.+)\\.groovy");
            }          
    }

Burkard

Graeme Rocher wrote:

> On 02/02/06, Dierk Koenig <[hidden email]> wrote:
>  
>> cool ! Congratulations ! That's a killer feature !
>>
>> The reload is triggered by automatically by file changes, or
>> is there some special Controller to invoke?
>>    
>
> Automatically triggered by file changes. There is a filter that
> detects file changes in the sources files when you do the "grails
> run-app" command reloads the necessary class performing the necessary
> action (re-mapping the domain classes for example)
>
> Graeme
>
>  
>> cheers
>> Mittie
>>
>>    
>>> -----Original Message-----
>>> From: [hidden email] [mailto:[hidden email]]On Behalf
>>> Of Graeme Rocher
>>> Sent: Donnerstag, 2. Februar 2006 11:38
>>> To: [hidden email]
>>> Subject: [grails-dev] Application Reloading in Grails
>>>
>>>
>>> Hi all,
>>>
>>> Thanks to the magic of Jochen's changes in the Groovy class loader
>>> Grails applications can now be reloaded on the fly!
>>>
>>> There are some quirks (I havn't figured out a way to reload
>>> transactional service classes) but on a whole it works well and is
>>> pretty fast. Particularily cool is when you have Hibernate
>>> automatically creating your schema with ddl auto you can update a
>>> domain class, refresh and the db schema will automatically be updated
>>> :-)
>>>
>>> Anyway a step in the right direction for Grails
>>>
>>> Graeme
>>>      
>
>  
Reply | Threaded
Open this post in threaded view
|

Re: Application Reloading in Grails

graemer
Thanks for the bug report Burkard! I will integrate your changes into CVS head

Graeme

On 05/02/06, Burkard Endres <[hidden email]> wrote:

> i found a problem on unix systems with classloading and reloading in grails
> in GrailsResourceHolder and in GrailsResourceHolder there is a Regular
> Expression compiled that fits
> only windows systems.
> on my iMac it doesnt work. I changed it to
>     public static Pattern GRAILS_RESOURCE_PATTERN =
> Pattern.compile(".+\\\\grails-app\\\\\\w+\\\\(.+)\\.groovy");
>     static{
>             if(File.separator.equals("/")){
>                 GRAILS_RESOURCE_PATTERN =
> Pattern.compile(".+/grails-app/\\w+/(.+)\\.groovy");
>             }
>     }
>
> Burkard
>
> Graeme Rocher wrote:
> > On 02/02/06, Dierk Koenig <[hidden email]> wrote:
> >
> >> cool ! Congratulations ! That's a killer feature !
> >>
> >> The reload is triggered by automatically by file changes, or
> >> is there some special Controller to invoke?
> >>
> >
> > Automatically triggered by file changes. There is a filter that
> > detects file changes in the sources files when you do the "grails
> > run-app" command reloads the necessary class performing the necessary
> > action (re-mapping the domain classes for example)
> >
> > Graeme
> >
> >
> >> cheers
> >> Mittie
> >>
> >>
> >>> -----Original Message-----
> >>> From: [hidden email] [mailto:[hidden email]]On Behalf
> >>> Of Graeme Rocher
> >>> Sent: Donnerstag, 2. Februar 2006 11:38
> >>> To: [hidden email]
> >>> Subject: [grails-dev] Application Reloading in Grails
> >>>
> >>>
> >>> Hi all,
> >>>
> >>> Thanks to the magic of Jochen's changes in the Groovy class loader
> >>> Grails applications can now be reloaded on the fly!
> >>>
> >>> There are some quirks (I havn't figured out a way to reload
> >>> transactional service classes) but on a whole it works well and is
> >>> pretty fast. Particularily cool is when you have Hibernate
> >>> automatically creating your schema with ddl auto you can update a
> >>> domain class, refresh and the db schema will automatically be updated
> >>> :-)
> >>>
> >>> Anyway a step in the right direction for Grails
> >>>
> >>> Graeme
> >>>
> >
> >
>