Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Need Premium Support?

ScaleOut Software offers customers several options for support and maintenance plans on a subscription basis for an annual fee.

Topics:

asked: Jun 19, 2017 at 04:37 PM

Seen: 270 times

Last Updated: Jun 27, 2017 at 10:15 PM

Set all cached object timeout from config file

Is there any configuration available in soss to set cached object time out either from web.config,soss_client_params or soss_params ?

Like ttlValue available in App-fabric :

  <localCache isEnabled="true" sync="TimeoutBased" ttlValue="300" objectCount="10000"/>  
more ▼

asked Jun 19, 2017 at 04:37 PM in Application Development

Raghu gravatar image

Raghu
1 2 5

(comments are locked)
10|5000 characters needed characters left

1 answer: sort voted first

The SOSS client library does not load any default settings from app.config by itself but it is trivial to do this in your own application code:

  1. Add a reference to System.Configuration to your project if you haven’t already.
  2. Add a new appSetting to your app.config file: <configuration><appSettings><add key=”sossTimeoutInMinutes” value=”60” />
  3. Add the following using statements to your source code file:

    using System.Configuration; 
    using System.Globalization;
    
  4. In your code, use this: myCache.DefaultCreatePolicy.TimeoutMinutes = Int32.Parse( ConfigurationManager.AppSettings[“sossTimeoutInMinutes”], CultureInfo.InvariantCulture );

You may want to cache the values in static state to improve performance too, so Int32.Parse isn’t invoked all the time, like so:

private static int _sossTimeoutInMinutes = Int32.Parse( ConfigurationManager.AppSettings[“sossTimeoutInMinutes”], CultureInfo.InvariantCulture );
// …
myCache.DefaultCreatePolicy.TimeoutMinutes = _sossTimeoutInMinutes;
more ▼

answered Jun 27, 2017 at 10:15 PM

Support gravatar image

ScaleOut Support Team ♦
1.9k 19 20 20

(comments are locked)
10|5000 characters needed characters left