ok i c so theres no possible way to share ? so how the dbs inside models
works? they have to re-execute every time requested?

On Sat, Aug 28, 2010 at 12:57 AM, mdipierro <[email protected]> wrote:

> not possible. A db contains an open socket. It cannot be serialized.
>
> On Aug 27, 12:54 pm, Phyo Arkar <[email protected]> wrote:
> > I am trying to store dynamically generated DB into session but it fails
> with
> > error  . is that supported or if i want to share DB Globally , across
> > controller , only within a session,  but it is dynamically generated how
> > should i share without puttint into models??
> >
> > case_db=DAL('mysql://r...@localhost/'+ request.vars.db_name)
> > case_db.define_table(...)
> > session.case_db=case_db
> >
> > Traceback (most recent call last):
> >   File "/home/v3ss/workspace-bbb/web2py-clone/gluon/main.py", line
> > 411, in wsgibase
> >
> >     session._try_store_on_disk(request, response)
> >
> >   File "/home/v3ss/workspace-bbb/web2py-clone/gluon/globals.py", line
> > 377, in _try_store_on_disk
> >
> >     cPickle.dump(dict(self), response.session_file)
> >
> >   File "/usr/lib/python2.6/copy_reg.py", line 74, in _reduce_ex
> >
> >     getstate = self.__getstate__
> >   File "/home/v3ss/workspace-bbb/web2py-clone/gluon/sql.py", line
> > 1380, in __getattr__
> >
> >     return dict.__getitem__(self,key)
> > KeyError: '__getstate__'
>

Reply via email to