SqlAzManStorage lifetime

Topics: NetSqlAzMan Core
Aug 5, 2011 at 8:59 PM
Edited Aug 5, 2011 at 9:08 PM

Hi there,

I'm just starting to implement NetSqlAzMan 3.6.0.9 on Windows 2003/2008.  I am going to be using it in an ASP.NET MVC 3 application and I was wondering if you have any recommendations for how the SqlAzManStorage should be handled?

Right now I am planning on creating the SqlAzManStorage object at application startup and just sharing across all sessions.  Is that safe to do?

Thanks.

Coordinator
Aug 6, 2011 at 9:59 AM

For an MVC application … the best is the NetSqlAzMan WCF Cache Service (see the video tutorial).

Why do you need to handle directly the IAzManStore ?

__________________________________
Andrea Ferendeles
NetSqlAzMan Project Coordinator
E-mail aferende@hotmail.com Web http://netsqlazman.codeplex.com

Aug 7, 2011 at 12:34 AM

I don't understand why I should prefer using the WCF Cache Service over connecting directly to the database (which is how the rest of the application is working).  Within the application we will be doing mostly CheckAccess() calls, although we will have an admin area where the user can make some security changes.  Either way, are there any recommendations for how long-lived an instance of the SqlAzManStorage object should be?  

Note: I edited the original question so if you got a notification by email I'm not sure you saw the edited version.  Apologies for taking the original question through a few revisions.  

Coordinator
Aug 11, 2011 at 12:39 PM

I always recommend to use the WCF cache service for performance reasons and for reasons relating to application architecture (SOA is better than direct access).

In any case you can use the Store / Storage instance smoothly and share it across all users (you can store it in an Application variable).

If instead you switch to the WCF cache service ... and you make changes to the permissions (at run-time) you have to remember to invalidate the cache of the WCF cache service by invoking the InvalidateCache method.

Regards,

Andrea.

__________________________________
Andrea Ferendeles
NetSqlAzMan Project Coordinator
E-mail aferende@hotmail.com Web http://netsqlazman.codeplex.com

Aug 18, 2011 at 1:17 AM

Thanks for the reply Andrea.  I'll look into the WCF cache service.