Hi Lakshani,

If *session data persistence* is not enabled, logged in user information
should be retrieved from Cache (Information only resides in cache).
Therefore you can get logged in user information directly from the cache.

If the *session data persistence *is enabled, then you can refer to DB
since all the session data is written into DB. Furthermore, If session data
persistence is enabled, there can be session data information which are not
in cache but still resides in DB (due to cache clearance or invalidation).
Therefore in this case the best option is to read session data from DB
rather than from the cache.

IMO, when the session data persistence is enabled,the better option is to
read data from DB. Because if you are reading from cache, you may need to
retrieve missing session information from DB (which are not in cache),
which is an additional cost since there is no direct attribute to find out
whether the particular session information resides only in DB or not.


On Mon, Mar 16, 2015 at 1:49 AM, Lakshani Gamage <laksh...@wso2.com> wrote:

> Thanks both of you. I will try those options.
>
> Thank you.
>
> On Mon, Mar 16, 2015 at 11:03 AM, Lasitha Wattaladeniya <lasit...@wso2.com
> > wrote:
>
>> Hi Lakshani,
>>
>> Even if the SessionDataPersist/RememberMe is not enabled the logged in
>> user details will be available in the cache (session data will be removed
>> after a time out period). In general session data will be available in
>> cache and also in the session persist database.
>>
>> Therefore you don't have to forcefully put everything to the db, you can
>> access from both cache and db.
>>
>> On Mon, Mar 16, 2015 at 1:42 AM, Lakshani Gamage <laksh...@wso2.com>
>> wrote:
>>
>>> Hi all,
>>> I'm working on my fast track project [1]. I have to monitor logged in
>>> users via  IS admin console. In the current implementation, logged in user
>>> details are saved in database if
>>> DBCPersistenceManager.SessionDataPersist.Enable = true. For that we
>>> have to enable below config in identity.xml.
>>>
>>> <JDBCPersistenceManager>
>>>         <SessionDataPersist>
>>>             <Enable>true</Enable>
>>>             <RememberMePeriod>60</RememberMePeriod>
>>>             <CleanUp>
>>>                 <Enable>false</Enable>
>>>                     <Period>1</Period>
>>>                     <TimeOut>60</TimeOut>
>>>             </CleanUp>
>>>             <Temporary>false</Temporary>
>>>         </SessionDataPersist>
>>>     </JDBCPersistenceManager>
>>>
>>> When above config is not enabled, when a user logs in, that user
>>> information is not saved in database. As I have to monitor all the logged
>>> in user details, I removed the
>>> DBCPersistenceManager.SessionDataPersist.Enable condition checking part
>>> from implementation of  authentication-framework component.  Is this ok?
>>>
>>> [1]. https://redmine.wso2.com/issues/3188
>>>
>>> Thank you.
>>> --
>>> Lakshani Gamage
>>>
>>> *Software Engineer*
>>> Mobile : +94 (0) 71 5478184 <%2B94%20%280%29%20773%20451194>
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Lasitha Wattaladeniya
>> Software Engineer
>> WSO2, Inc. | http://wso2.com
>> lean. enterprise. middleware
>>
>> Mobile : +94719397528
>> Blog : techreadme.blogspot.com
>>
>
>
>
> --
> Lakshani Gamage
>
> *Software Engineer*
> Mobile : +94 (0) 71 5478184 <%2B94%20%280%29%20773%20451194>
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Hasintha Indrajee
Software Engineer
WSO2, Inc.
Mobile:+94 771892453
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to