S
Soeren S. Joergensen
Hi,
A customer of mine (or actually the security department of this company)
requires that SQL connections are handet out from COM+ server object. The
connection will be used from a web application. The idea is to let the COM+
object create a new SqlConnection with integrated security set, so that the
user doing the actual connecting to the SQL server is the user configured to
run the COM+ object. Thereby there will be no unsecured connection strings
floating around in web.config files ect. The ASPNET account of the web
server is then put into the COM+ objects list of users who are able to use
the object. A very secure way to protect your SQL server
But:
When creating a simple COM+ server, putting a method in it that hands out a
new connection I get following exception when using the connection. The
connection is not null - but I guess it is cought by the GC before it is
finished doing it's job ??
System.Runtime.Remoting.RemotingException: This remoting proxy has no
channel sink which means either the server has no registered server channels
that are listening, or this application has no suitable client channel to
talk to the server.
Does anyone know what could be wrong ??
Server component looks something like:
[SecurityRole("Users", true)]
public class ConnectionFactory : ServicedComponent
{
public ConnectionFactory() : base()
{
}
[AutoComplete]
public SqlConnection GetConnection()
{
return new
SqlConnection("Server=MySqlServer;Database=MySqlDB;Integrated
Security=SSPI;Persist Security Info=False");
}
}
Client uses the server object as follows:
private void MyMethodThatRequiresAConnection()
{
ConnectionFactory factory = new ConnectionFactory();
SqlConnection conn = factory.GetConnection();
if(conn != null)
{
try
{
// Do something, fill a dataset or what ever
}
catch(Exception e)
{
Debug.WriteLine(e);
}
finally
{
conn.Close();
}
}
}
Btw. I don't need comments about if this is a usefull method or not, or
whether performance will go up or down - there is simply no way around this,
it's a customer requirement
Thanks in advance...
Kr.
Soren
A customer of mine (or actually the security department of this company)
requires that SQL connections are handet out from COM+ server object. The
connection will be used from a web application. The idea is to let the COM+
object create a new SqlConnection with integrated security set, so that the
user doing the actual connecting to the SQL server is the user configured to
run the COM+ object. Thereby there will be no unsecured connection strings
floating around in web.config files ect. The ASPNET account of the web
server is then put into the COM+ objects list of users who are able to use
the object. A very secure way to protect your SQL server

But:
When creating a simple COM+ server, putting a method in it that hands out a
new connection I get following exception when using the connection. The
connection is not null - but I guess it is cought by the GC before it is
finished doing it's job ??
System.Runtime.Remoting.RemotingException: This remoting proxy has no
channel sink which means either the server has no registered server channels
that are listening, or this application has no suitable client channel to
talk to the server.
Does anyone know what could be wrong ??
Server component looks something like:
[SecurityRole("Users", true)]
public class ConnectionFactory : ServicedComponent
{
public ConnectionFactory() : base()
{
}
[AutoComplete]
public SqlConnection GetConnection()
{
return new
SqlConnection("Server=MySqlServer;Database=MySqlDB;Integrated
Security=SSPI;Persist Security Info=False");
}
}
Client uses the server object as follows:
private void MyMethodThatRequiresAConnection()
{
ConnectionFactory factory = new ConnectionFactory();
SqlConnection conn = factory.GetConnection();
if(conn != null)
{
try
{
// Do something, fill a dataset or what ever
}
catch(Exception e)
{
Debug.WriteLine(e);
}
finally
{
conn.Close();
}
}
}
Btw. I don't need comments about if this is a usefull method or not, or
whether performance will go up or down - there is simply no way around this,
it's a customer requirement

Thanks in advance...
Kr.
Soren