that machinery is only needed for a module that needs to be used within 
web2py, as cache and session need (and should) use a single object per 
class with namespaced keys. Also, there's really no point or any 
performance benefit on using separate databases in redis, and they're 
unofficially deprecated because they're not working reallty fine with the 
new redis cluster. it's far better to namespace your keys.

tl;dr: no, RConn() wasn't made with databases preselection in mind, mostly 
because there's no need to.

On Thursday, April 21, 2016 at 7:41:43 PM UTC+2, Mirek Zvolský wrote:
>
> I try understand how redis support should work.
>
> In the contrib web2py code I see function RConn() with code inside:
>  
>
>> instance_name = 'redis_conn_' + current.request.application
>
> if not hasattr(RConn, instance_name):
>
>     setattr(RConn, instance_name, StrictRedis(*args, **vars))
>
>
> It looks like this should separate (isolate) redis/StrictRedis instances 
> by request.application.
>
> However, if I create 2 redis/StrictRedis instances and save them as 2 
> different variables,
> they will share same data.
> To really separate them, I need set different db=NNN parameter:
>
> r1 = StrictRedis()
> r2 = StrictRedis()
> will be same,
>
> but
> r1 = StrictRedis(db=1)
> r2 = StrictRedis(db=2)
> will be different.
>
> So, is the per application isolation really working?
>
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to