James Gardner wrote:
Hi jw,

This is because a new instance of the controller object is created on
each request, if it wasn't, your controllers would not be thread safe
because class members set by one thread might be read by another.

Hi James,

Is that right that the only reason why contoller instance is created
for each request is that somebody could try to use it as per-request
storage? Why would anybody do such things? Isn't request.environ a
better place for that? I think it is quite sane to reuse controller
instance for performance sake.

Well, I'd see people making db connection in base controller's
__call__() method. But if that's only for thread-safety, then problem
whould be better solved using thread local variable.

I might be missing some other important points here.

Cheers,
Alexander


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to