SQL CLR Stored Procedure with Windows server AppFabric (DataCacheFactory error)

Unanswered SQL CLR Stored Procedure with Windows server AppFabric (DataCacheFactory error)

  • Friday, May 20, 2011 5:03 AM
     
     
    I am trying to make calls to  windows appfabric cache  from SQL CLR as stored procedure. But the creation of "DataCacheFactory" is throwing error.

    New assembly (CLR) is deployed on SQL Server 2008 R2 which is making calls to Appfabric cache server. (I am not using WCF). This is a class library.

    "DataCacheFactory" object creation is throwing error. I will update this post with more error details shortly.
      I am having "path is not a legal form" error when "GetCache" is called on factory object. I am receiving this error ONLY when calls are made by SQL CLR (stored procedure) (SQL server 2008 R2). When a call is made to the GetCache using Console application, I don't see the error,it runs fine. Initially my thought is with user account permissions. But not sure, why would it say "Path is not a legal from" if its a permission issue. Please advice. Your advices are appreciated.
    • Edited by sai.bolla Saturday, May 21, 2011 2:20 AM
    •  

All Replies

  • Friday, May 20, 2011 1:17 PM
     
     
    I am trying to make calls to  windows appfabric cache  from SQL CLR as stored procedure. But the creation of "DataCacheFactory" is throwing error.

    New assembly (CLR) is deployed on SQL Server 2008 R2 which is making calls to Appfabric cache server. (I am not using WCF). This is a class library.

    "DataCacheFactory" object creation is throwing error. I will update this post with more error details shortly.
     
    Without the further details you've said you'll provide, I'd take a guess and say it's a configuration issue or a network access/security issue. Whats your config look like, both server and client?
    Microsoft Community Contributor MCTS: .NET 4.0 Service Communication Applications
  • Wednesday, December 28, 2011 10:07 PM
     
     
    Did you ever resolve this?  I'm trying the exact same thing and running into the same error.  I had a similar problem working with NCache via a CLR stored proc, but they issued an update which resolved the problem.  In their case, it had to to with accessing a config file, which when running withing SQL Server (as a CLR proc does), has to be located in the root directory for SQL Server.  I'm wondering if this is the same sort of issue, but I don't know what config file it would be trying to access when a client is trying to access the cache.
  • Friday, January 06, 2012 3:32 PM
     
     

    Where did you put your dataCacheClient configuration settings?

    A CLR stored procedure runs in the context of SQL Server, in other words: the sqlservr.exe process.

    Something you could try:

    1) Create a config file as sqlservr.exe.config in the \Binn folder under the root path of the SQL Instance.

    2) Include the dataCacheClient configuration settings in this config file.

    3) Restart the SQL services.


    • Edited by Nils Gruson Friday, January 06, 2012 3:33 PM
    •  
  • Saturday, January 07, 2012 6:17 PM
     
     

    Sai,

    I suggest you investigate whether the cache client meets SQL Clr integration reliability requirements (e.g is it supported ?).

    Calling .net code in SQL Server, while simple in implementation, has many implications …

    I would be VERY careful before referencing non-BCL API’s in my SP’s (especially BIG ones; even from Microsoft :)

    FYI:

    http://msdn.microsoft.com/en-us/library/ms228970.aspx

    http://msdn.microsoft.com/en-us/library/ms172338.aspx

    -Itai


    itai
  • Monday, January 09, 2012 11:49 PM
     
     

    Thanks for the reply Nils, but that didn't work for me.  I already had a config file for sql server which I know works because I've used keys from it in another CLR proc.  Even though my instantiation of of the datacacheclient provided all configuration via code, it still attempts to load some file and fails because of a bad path.  When I put all the configuration values into the sqlservr.exe.config file, I get the exact same error.  It behaves as if regardless of whether you provide configuration data in code or in the config file, it's trying to load some other file and failing.

    I wonder if anyone from MS has tried referencing the AppFabric cache assemblies within any CLR proc or trigger successfully?  My guess is there is an internal exception that is beyond a consumer's control.