this is not a web2py issue. This is an issue for all web applications. What if your application is replicated on two server behing a load balancer? The two servers cannot share objects. What if you use a web servers that forks (apache can) than different requests are executed by different processes, not different threads? Processes cannot share objects. What if you have to restart the web server for maintenance purposes? Do you want to store all persistent data? The same user may request two pages and these two pages may be server by different servers or different processes.
Web applications must be written without persistent objects. State is share using the database, using sessions and using cache. The bahvior you seek can be mimicked by serializing/deserializing the objects at every request in session or cache. Massimo On Oct 30, 4:39 am, evilaliv3 <evilal...@gmail.com> wrote: > On 30 Ott, 00:39, Massimo Di Pierro <massimo.dipie...@gmail.com> > wrote: > > > You must use cache.ram but this is not guaranteed to work. > > Excuse me Massimo, > but, if i understand well this answer, there is no way to have also a > persistent connection to the database or a global application variable > in web2py? > for every request the whole application is reinitialized? > > > In a multi-threaded environment the web server decides which threads > > to start/stop/kill. > > does this happen in a deterministic fashion? is there some > documentation about? > > Giovanni Pellerano