You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by Alex Orlov <oo...@mail.ru> on 2020/11/09 21:46:17 UTC

Shiro Realm and Session tread-safety?

Hi all,
 
As I understand Shiro must be thread-safe. However, I couldn’t find any information about
multithreading support, so, to be sure decided to ask several questions. Could anyone say, if
 
1) this code with sessions is thread-safe?
    for (Session session: sessionDao.getActiveSessions()){
           …..
            session.stop();
    }
 
2) Real#clearCachedAuthorizationInfo(PrincipalCollection principals) method is thread-safe?
 
--
Best regards, Alex Orlov

Re[2]: Shiro Realm and Session tread-safety?

Posted by Alex Orlov <oo...@mail.ru>.
Hi Brian,
 
Thank you very much for clarifying.
 
 
--
Best regards, Alex Orlov
 
  
>Вторник, 10 ноября 2020, 17:52 +03:00 от Brian Demers <br...@gmail.com>:
> 
>Yes, they are, but that concern is up to the implementation of the cache/session impl. So if you have a custom implementation you will need to ensure that code is also thread safe.
>   
>On Mon, Nov 9, 2020 at 4:46 PM Alex Orlov < ooo_saturn7@mail.ru > wrote:
>>Hi all,
>> 
>>As I understand Shiro must be thread-safe. However, I couldn’t find any information about
>>multithreading support, so, to be sure decided to ask several questions. Could anyone say, if
>> 
>>1) this code with sessions is thread-safe?
>>    for (Session session: sessionDao.getActiveSessions()){
>>           …..
>>            session.stop();
>>    }
>> 
>>2) Real#clearCachedAuthorizationInfo(PrincipalCollection principals) method is thread-safe?
>> 
>>--
>>Best regards, Alex Orlov
 

Re: Shiro Realm and Session tread-safety?

Posted by Brian Demers <br...@gmail.com>.
Yes, they are, but that concern is up to the implementation of the
cache/session impl. So if you have a custom implementation you will need to
ensure that code is also thread safe.


On Mon, Nov 9, 2020 at 4:46 PM Alex Orlov <oo...@mail.ru> wrote:

> Hi all,
>
> As I understand Shiro must be thread-safe. However, I couldn’t find any
> information about
> multithreading support, so, to be sure decided to ask several questions.
> Could anyone say, if
>
> 1) this code with sessions is thread-safe?
>     for (Session session: sessionDao.getActiveSessions()){
>            …..
>             session.stop();
>     }
>
> 2) Real#clearCachedAuthorizationInfo(PrincipalCollection principals)
> method is thread-safe?
>
> --
> Best regards, Alex Orlov
>