Issue with WARestfulHandler

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

Issue with WARestfulHandler

Gerhard Obermann
Hi,

I would suggest to change the method "routes" see below.
The old method doesn't allow recaching of the instVar "routes", even if i set the shouldCacheRoutes to false.

routes
"Answer a collection of routes for the receiver."

^ routes ifNil: [ 
self shouldCacheRoutes
ifFalse: [ self createRoutes ]
ifTrue: [ routes := self createRoutes ] ]

to 

routes
"Answer a collection of routes for the receiver."
^self shouldCacheRoutes
ifFalse: [ self createRoutes ]
ifTrue: [  routes ifNil: [ routes := self createRoutes ] ]

Cheers
Gerhard

_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue with WARestfulHandler

Johan Brichau-2
Hi Gerhard,

If you set the caching to false, you should also clear the cache, because also with your suggested change, when you re-enable the cache, you will get the old cached routes back again.

But you are right that there is no support to turn off the cache or clear it, perhaps a #clearRoutesCache method is missing?
If you want to turn off the caching, you would need invoke it too.

Would that work for you?

Johan

On 06 Apr 2014, at 19:37, Gerhard Obermann <[hidden email]> wrote:

> Hi,
>
> I would suggest to change the method "routes" see below.
> The old method doesn't allow recaching of the instVar "routes", even if i set the shouldCacheRoutes to false.
>
> routes
> "Answer a collection of routes for the receiver."
>
> ^ routes ifNil: [
> self shouldCacheRoutes
> ifFalse: [ self createRoutes ]
> ifTrue: [ routes := self createRoutes ] ]
>
> to
>
> routes
> "Answer a collection of routes for the receiver."
> ^self shouldCacheRoutes
> ifFalse: [ self createRoutes ]
> ifTrue: [  routes ifNil: [ routes := self createRoutes ] ]
>
> Cheers
> Gerhard
> _______________________________________________
> seaside-dev mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev

_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue with WARestfulHandler

Gerhard Obermann
Ups, that wasn't my latest version.
I think its the easiest way to always set the instVar if caching is disabled.
 
routes
"Answer a collection of routes for the receiver."
^self shouldCacheRoutes
ifFalse: [ routes := self createRoutes ]
ifTrue: [  routes ifNil: [ routes := self createRoutes ] ]



On Sun, Apr 6, 2014 at 10:46 PM, Johan Brichau <[hidden email]> wrote:
Hi Gerhard,

If you set the caching to false, you should also clear the cache, because also with your suggested change, when you re-enable the cache, you will get the old cached routes back again.

But you are right that there is no support to turn off the cache or clear it, perhaps a #clearRoutesCache method is missing?
If you want to turn off the caching, you would need invoke it too.

Would that work for you?

Johan

On 06 Apr 2014, at 19:37, Gerhard Obermann <[hidden email]> wrote:

> Hi,
>
> I would suggest to change the method "routes" see below.
> The old method doesn't allow recaching of the instVar "routes", even if i set the shouldCacheRoutes to false.
>
> routes
>       "Answer a collection of routes for the receiver."
>
>       ^ routes ifNil: [
>               self shouldCacheRoutes
>                       ifFalse: [ self createRoutes ]
>                       ifTrue: [ routes := self createRoutes ] ]
>
> to
>
> routes
>       "Answer a collection of routes for the receiver."
>       ^self shouldCacheRoutes
>                       ifFalse: [ self createRoutes ]
>                       ifTrue: [  routes ifNil: [ routes := self createRoutes ] ]
>
> Cheers
> Gerhard
> _______________________________________________
> seaside-dev mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev

_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev


_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue with WARestfulHandler

Philippe Marschall
On Mon, Apr 7, 2014 at 7:01 AM, Gerhard Obermann <[hidden email]> wrote:
> Ups, that wasn't my latest version.
> I think its the easiest way to always set the instVar if caching is
> disabled.

Just out of curiosity, how do you toggle between caching and not caching?

Cheers
Philippe
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue with WARestfulHandler

Gerhard Obermann
Good question!

At the moment during the development not needed.

But for the production system i will overwrite "shouldCacheRoutes" to return true.
Well, still looking for a good solution to do the recaching at least after i have updated my packages.

Gerhard










On Mon, Apr 7, 2014 at 12:06 PM, Philippe Marschall <[hidden email]> wrote:
On Mon, Apr 7, 2014 at 7:01 AM, Gerhard Obermann <[hidden email]> wrote:
> Ups, that wasn't my latest version.
> I think its the easiest way to always set the instVar if caching is
> disabled.

Just out of curiosity, how do you toggle between caching and not caching?

Cheers
Philippe
_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev


_______________________________________________
seaside-dev mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/seaside-dev