Looking at the rest of globals.py I don't think this approach will work. 
 For one, it affects storing sessions in any database, not just redis. 
 Since the table is declared with a "boolean" field I don't think its gonna 
like the string version of "False".

I wonder why we don't have a simple minded dialect in DAL for redis. 
 Admittedly, it's not a RDBMS so a lot of DAL just won't ever work on 
redis.  But it would have provided a clean place to map "booleans" to 
strings instead of bools in this case, making it easy to special-case redis.

But maybe that would encourage people to complain that the implementation 
of the redis DAL dialect is too deficient.  Putting it in DAL would raise 
people's expectations of what it can handle.

-- Joe


On Sunday, March 31, 2019 at 10:19:20 AM UTC-7, Jim S wrote:
>
> I changed the following in gluon/globals.py and mine is working now.  But, 
> I'm unclear on how to test to see if it is handling the locking properly:
>
> dd = dict(locked=False,
>           client_ip=response.session_client,
>           modified_datetime=request.now,
>           session_data=session_pickled,
>           unique_key=unique_key)
>
> to 
>
> dd = dict(locked='False',
>           client_ip=response.session_client,
>           modified_datetime=str(request.now),
>           session_data=session_pickled,
>           unique_key=unique_key)
>
> This makes all my stuff work (I'm still on Python 2.7 but I think the 
> problem has to do with the python redis client moving to version 3).
>
> Leonel - I think this relates back to an issue you commented on late last 
> year.   
> https://groups.google.com/forum/?pli=1#!searchin/web2py/redis%7Csort:date/web2py/PdquGF_9a2E/6VJpLqsnBgAJ
>
> At that time I just continued using python redis 2.10.6.  But, can't do 
> that forever.  Anyone able to test or improve upon the change I made 
> above?  Like I said, it works for me, but I don't know how to see if I'm 
> causing any other unforeseen damage.
>
> -Jim
>
> On Friday, March 29, 2019 at 7:49:03 PM UTC-5, Joe Barnhart wrote:
>>
>> Hi Leonel --
>>
>> My brain refuses to put together the words "session locked field".  I 
>> understand the part of pickle smashing the values and encoding them as one 
>> string.  The bool has something to do with session locking?  
>>
>> I've only looked at the web2py redis code in the most scant way as I 
>> wasn't planning to become a redis expert.  Sessions in redis could be 
>> important to me, tho, so I may need to set aside some time to dig into it. 
>>  (Storing sessions in cookies has been problematic due to the limited space 
>> for cookies in browsers.)
>>
>> -- Joe
>>
>>
>> On Wednesday, March 27, 2019 at 4:49:25 PM UTC-7, Leonel Câmara wrote:
>>>
>>> It's not your values Joe, pickle serializes them as a string so they 
>>> would be fine. It's web2py session locked field which is True or False. 
>>> It's probably easy to fix this in redis_session.py
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to