List Info

Thread: When to instatiate templates, db connections etc.




When to instatiate templates, db connections etc.
user name
2006-03-22 16:55:49
Hi all,

My application requires several objects to be created -
things such as
a db connection, some meld3 templates and a formencode
validation
object.

There is a very useful recipe that explains how to create db
connections per thread and I use this successfully to create
connections to an SQlite file.

Is this also the best way to create other objects that are
shared by my
exposed methods?

Could I create the meld3 templates just once on server.start
and share
them amongst threads?

Or is there a reason to create these objects every time an
exposed
method is called? (I can't think of one).

Cheers,

Rob C


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---

When to instatiate templates, db connections etc.
user name
2006-03-22 16:58:20
Please excuse the spelling mistakes in the previous post!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )