Closed :)

On Sat, Aug 28, 2010 at 1:24 AM, Phyo Arkar <[email protected]>wrote:

> thanks massimo
>
> so now i try to re execute :
>
>
> >
> > case_db=DAL('mysql://root@
> localhost/'+ request.vars.db_name)
> > case_db.define_table(...)
> > session.case_db=case_db
>
> on every controller of every function which needs it.
>
>
> On Sat, Aug 28, 2010 at 12:56 AM, mdipierro <[email protected]>wrote:
>
>> It is not possible because a DB contains a database connection. That
>> 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