Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

Microsoft.AnalysisServices.Server .Net connection is locking up SSAS server

$
0
0

Hi,

I am making a connection from a web service to a SQL 2005 SSAS server using the Microsoft.AnalysisServices.Server (source: Microsoft.AnalysisServices.DLL version 9.0.4035.00) package, and using that connection to add users to a database role.  This executes successfully, but every time after it is complete the SSAS server hangs for about an hour.  Trying to connect to it with SSMS, I get "Connection timed out".  I am calling the Server.Disconnect() method at the end of my call so shouldn't that stop any blocking in the server?  See my code below.  Thanks for your help!

Microsoft.AnalysisServices.Server server = null;
            bool success = false;
            //Get connection string
            try
            {
                string connectionString = WebConfigurationManager.ConnectionStrings[ServerConfigName].ConnectionString;
                server = new Microsoft.AnalysisServices.Server();
                server.Connect(connectionString);
                if (server.Connected)
                {
                    Microsoft.AnalysisServices.Database database = server.Databases.FindByName(DatabaseName);
                    if (database != null)
                    {
                        Microsoft.AnalysisServices.Role role = database.Roles.FindByName(roleName);
                        if (role != null)
                        {
                            RoleMember rm = new RoleMember(userDomain);
                            if (!role.Members.Contains(rm))
                                role.Members.Add(rm);
                            role.Update();
                            success = true;
                        }
                    }
                }
            }
            finally
            {
                if (server != null && server.Connected)
                {
                    server.Disconnect();
                }
            }


Viewing all articles
Browse latest Browse all 2472

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>