Tuesday, March 27, 2012
connection problem
An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: Named Pipes Provider, error: 40 - Could not open
a connection to SQL Server)
From the following code:
<%@. Page Language="VB" Debug="true" %>
<script runat="server">
Dim ConnectionString As String = "server=
(local);database=ASPExamples"
Dim SelectCommand As String = "SELECT CustomerID, name, phone from
customers"
Dim isEditing As Boolean = False
Dim myConnection As New SqlConnection(ConnectionString)
Dim myCommand As New SqlDataAdapter(SelectCommand, myConnection)
Dim ds As New DataSet()
myCommand.Fill(ds)
DataGrid1.DataSource = ds
DataGrid1.DataBind()
End SubSee:
http://betav.com/blog/billva/2006/0...onnected_1.html
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
----
---
"Roger Halls" <roghalls@.gmail.com> wrote in message
news:Xns992A7925D4244roghallsgmailcom@.19
8.186.190.150...
>I get the following message:
> An error has occurred while establishing a connection to the server.
> When connecting to SQL Server 2005, this failure may be caused by the
> fact that under the default settings SQL Server does not allow remote
> connections. (provider: Named Pipes Provider, error: 40 - Could not open
> a connection to SQL Server)
> From the following code:
> <%@. Page Language="VB" Debug="true" %>
> <script runat="server">
> Dim ConnectionString As String = "server=
> (local);database=ASPExamples"
> Dim SelectCommand As String = "SELECT CustomerID, name, phone from
> customers"
> Dim isEditing As Boolean = False
> Dim myConnection As New SqlConnection(ConnectionString)
> Dim myCommand As New SqlDataAdapter(SelectCommand, myConnection)
> Dim ds As New DataSet()
> myCommand.Fill(ds)
> DataGrid1.DataSource = ds
> DataGrid1.DataBind()
>
> End Sub
Connection Problem
I use the following code lines for connecting to SQL Server 2005 using
JDBC in Java:
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String connectionUrl =
"jdbc:sqlserver:// SERVER;user=USER;databaseName=db;Authent
icationMethod=auto
";
but I got the error: Login failed for user 'USER'
I want to use windows authentication and I am pretty sure I use the
correct username. Can you please help me?
Thanks a lot.AuthenticationMethod=auto is correct but you would not
supply a user in the connection string to have the
connection use Windows authentication. If you supply the
user, it will use SQL authentication, not windows.
-Sue
On 9 Oct 2006 00:56:14 -0700, "sara" <sarasara82@.gmail.com>
wrote:
>Hi All,
>I use the following code lines for connecting to SQL Server 2005 using
>JDBC in Java:
>Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
> String connectionUrl =
>"jdbc:sqlserver:// SERVER;user=USER;databaseName=db;Authent
icationMethod=aut
o";
>but I got the error: Login failed for user 'USER'
>I want to use windows authentication and I am pretty sure I use the
>correct username. Can you please help me?
>Thanks a lot.
Sunday, March 25, 2012
Connection Problem
I use the following code lines for connecting to SQL Server 2005 using
JDBC in Java:
Class.forName("com.microsoft.sqlserver.jdbc.SQLSer verDriver");
String connectionUrl =
"jdbc:sqlserver://SERVER;user=USER;databaseName=db;AuthenticationMet hod=auto";
but I got the error: Login failed for user 'USER'
I want to use windows authentication and I am pretty sure I use the
correct username. Can you please help me?
Thanks a lot.
AuthenticationMethod=auto is correct but you would not
supply a user in the connection string to have the
connection use Windows authentication. If you supply the
user, it will use SQL authentication, not windows.
-Sue
On 9 Oct 2006 00:56:14 -0700, "sara" <sarasara82@.gmail.com>
wrote:
>Hi All,
>I use the following code lines for connecting to SQL Server 2005 using
>JDBC in Java:
>Class.forName("com.microsoft.sqlserver.jdbc.SQLSe rverDriver");
> String connectionUrl =
>"jdbc:sqlserver://SERVER;user=USER;databaseName=db;AuthenticationMet hod=auto";
>but I got the error: Login failed for user 'USER'
>I want to use windows authentication and I am pretty sure I use the
>correct username. Can you please help me?
>Thanks a lot.
sqlsql
connection problem
An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: Named Pipes Provider, error: 40 - Could not open
a connection to SQL Server)
From the following code:
<%@. Page Language="VB" Debug="true" %>
<script runat="server">
Dim ConnectionString As String = "server=
(local);database=ASPExamples"
Dim SelectCommand As String = "SELECT CustomerID, name, phone from
customers"
Dim isEditing As Boolean = False
Dim myConnection As New SqlConnection(ConnectionString)
Dim myCommand As New SqlDataAdapter(SelectCommand, myConnection)
Dim ds As New DataSet()
myCommand.Fill(ds)
DataGrid1.DataSource = ds
DataGrid1.DataBind()
End Sub
See:
http://betav.com/blog/billva/2006/06/getting_and_staying_connected_1.html
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"Roger Halls" <roghalls@.gmail.com> wrote in message
news:Xns992A7925D4244roghallsgmailcom@.198.186.190. 150...
>I get the following message:
> An error has occurred while establishing a connection to the server.
> When connecting to SQL Server 2005, this failure may be caused by the
> fact that under the default settings SQL Server does not allow remote
> connections. (provider: Named Pipes Provider, error: 40 - Could not open
> a connection to SQL Server)
> From the following code:
> <%@. Page Language="VB" Debug="true" %>
> <script runat="server">
> Dim ConnectionString As String = "server=
> (local);database=ASPExamples"
> Dim SelectCommand As String = "SELECT CustomerID, name, phone from
> customers"
> Dim isEditing As Boolean = False
> Dim myConnection As New SqlConnection(ConnectionString)
> Dim myCommand As New SqlDataAdapter(SelectCommand, myConnection)
> Dim ds As New DataSet()
> myCommand.Fill(ds)
> DataGrid1.DataSource = ds
> DataGrid1.DataBind()
>
> End Sub
Thursday, March 22, 2012
Connection pooling & Windows authentication
I'm connecting to SqlServer 2000 from an ASP.NET web application.
The web application runs under a specific Identity (impersonating to a
specific windows account), the connection string contains
"IntegratedSecurity=SSPI",
and as far as I can see, it (the connection string) is constant.
Will my web application be using the connection pooling mechanism? I'm
asking this because I've been reading that if the conenction string
is constant, the connection pool will be used, however, I haven't found
anything about windows authentication, where the username and password
aren't specified in the connection string, but are managed by windows,
therefore I can't really say if the connection srting is different or not.
Thanks, Gai.
Gai
Visit on this web site
http://www.able-consulting.com/ADO_C...erForSQLServer -- CONNECTIONS
"Gai" <gaitamir@.IBezint> wrote in message
news:%23we0Fah0EHA.1396@.tk2msftngp13.phx.gbl...
> Hey all,
> I'm connecting to SqlServer 2000 from an ASP.NET web application.
> The web application runs under a specific Identity (impersonating to a
> specific windows account), the connection string contains
> "IntegratedSecurity=SSPI",
> and as far as I can see, it (the connection string) is constant.
> Will my web application be using the connection pooling mechanism? I'm
> asking this because I've been reading that if the conenction string
> is constant, the connection pool will be used, however, I haven't found
> anything about windows authentication, where the username and password
> aren't specified in the connection string, but are managed by windows,
> therefore I can't really say if the connection srting is different or not.
> Thanks, Gai.
>
Connection pooling & Windows authentication
I'm connecting to SqlServer 2000 from an ASP.NET web application.
The web application runs under a specific Identity (impersonating to a
specific windows account), the connection string contains
"IntegratedSecurity=SSPI",
and as far as I can see, it (the connection string) is constant.
Will my web application be using the connection pooling mechanism? I'm
asking this because I've been reading that if the conenction string
is constant, the connection pool will be used, however, I haven't found
anything about windows authentication, where the username and password
aren't specified in the connection string, but are managed by windows,
therefore I can't really say if the connection srting is different or not.
Thanks, Gai.
As far as I know, if you create a connection to the sql server and then
impersonate a new user and make a new connection, a new connection pool gets
created even if the connection string is the same.
Hopes this helps
Marc
"Gai" <gaitamir@.IBezint> wrote in message
news:#otPhYh0EHA.2568@.TK2MSFTNGP10.phx.gbl...
> Hey all,
> I'm connecting to SqlServer 2000 from an ASP.NET web application.
> The web application runs under a specific Identity (impersonating to a
> specific windows account), the connection string contains
> "IntegratedSecurity=SSPI",
> and as far as I can see, it (the connection string) is constant.
> Will my web application be using the connection pooling mechanism? I'm
> asking this because I've been reading that if the conenction string
> is constant, the connection pool will be used, however, I haven't found
> anything about windows authentication, where the username and password
> aren't specified in the connection string, but are managed by windows,
> therefore I can't really say if the connection srting is different or not.
> Thanks, Gai.
>
|||Yes, but again, I'm impersonating a single user (not the running user, but
DomainA\UsernameA).
Hope it's more clear now.
Thanks any way, Gai.
"Marc Mertens" <marc.mertens@.azlan.com> wrote in message
news:eGpFc6s0EHA.1260@.TK2MSFTNGP12.phx.gbl...
> As far as I know, if you create a connection to the sql server and then
> impersonate a new user and make a new connection, a new connection pool
gets[vbcol=seagreen]
> created even if the connection string is the same.
> Hopes this helps
> Marc
> "Gai" <gaitamir@.IBezint> wrote in message
> news:#otPhYh0EHA.2568@.TK2MSFTNGP10.phx.gbl...
not.
>
Connection pooling & Windows authentication
I'm connecting to SqlServer 2000 from an ASP.NET web application.
The web application runs under a specific Identity (impersonating to a
specific windows account), the connection string contains
"IntegratedSecurity=SSPI",
and as far as I can see, it (the connection string) is constant.
Will my web application be using the connection pooling mechanism? I'm
asking this because I've been reading that if the conenction string
is constant, the connection pool will be used, however, I haven't found
anything about windows authentication, where the username and password
aren't specified in the connection string, but are managed by windows,
therefore I can't really say if the connection srting is different or not.
Thanks, Gai.Gai
Visit on this web site
http://www.able-consulting.com/ADO_...derForSQLServer --
CONNECTIONS
"Gai" <gaitamir@.IBezint> wrote in message
news:%23we0Fah0EHA.1396@.tk2msftngp13.phx.gbl...
> Hey all,
> I'm connecting to SqlServer 2000 from an ASP.NET web application.
> The web application runs under a specific Identity (impersonating to a
> specific windows account), the connection string contains
> "IntegratedSecurity=SSPI",
> and as far as I can see, it (the connection string) is constant.
> Will my web application be using the connection pooling mechanism? I'm
> asking this because I've been reading that if the conenction string
> is constant, the connection pool will be used, however, I haven't found
> anything about windows authentication, where the username and password
> aren't specified in the connection string, but are managed by windows,
> therefore I can't really say if the connection srting is different or not.
> Thanks, Gai.
>
Connection pooling & Windows authentication
I'm connecting to SqlServer 2000 from an ASP.NET web application.
The web application runs under a specific Identity (impersonating to a
specific windows account), the connection string contains
"IntegratedSecurity=SSPI",
and as far as I can see, it (the connection string) is constant.
Will my web application be using the connection pooling mechanism? I'm
asking this because I've been reading that if the conenction string
is constant, the connection pool will be used, however, I haven't found
anything about windows authentication, where the username and password
aren't specified in the connection string, but are managed by windows,
therefore I can't really say if the connection srting is different or not.
Thanks, Gai.Gai
Visit on this web site
http://www.able-consulting.com/ADO_Conn.htm#OLEDBProviderForSQLServer -- CONNECTIONS
"Gai" <gaitamir@.IBezint> wrote in message
news:%23we0Fah0EHA.1396@.tk2msftngp13.phx.gbl...
> Hey all,
> I'm connecting to SqlServer 2000 from an ASP.NET web application.
> The web application runs under a specific Identity (impersonating to a
> specific windows account), the connection string contains
> "IntegratedSecurity=SSPI",
> and as far as I can see, it (the connection string) is constant.
> Will my web application be using the connection pooling mechanism? I'm
> asking this because I've been reading that if the conenction string
> is constant, the connection pool will be used, however, I haven't found
> anything about windows authentication, where the username and password
> aren't specified in the connection string, but are managed by windows,
> therefore I can't really say if the connection srting is different or not.
> Thanks, Gai.
>
Connection pooling & Windows authentication
I'm connecting to SqlServer 2000 from an ASP.NET web application.
The web application runs under a specific Identity (impersonating to a
specific windows account), the connection string contains
"IntegratedSecurity=SSPI",
and as far as I can see, it (the connection string) is constant.
Will my web application be using the connection pooling mechanism? I'm
asking this because I've been reading that if the conenction string
is constant, the connection pool will be used, however, I haven't found
anything about windows authentication, where the username and password
aren't specified in the connection string, but are managed by windows,
therefore I can't really say if the connection srting is different or not.
Thanks, Gai.As far as I know, if you create a connection to the sql server and then
impersonate a new user and make a new connection, a new connection pool gets
created even if the connection string is the same.
Hopes this helps
Marc
"Gai" <gaitamir@.IBezint> wrote in message
news:#otPhYh0EHA.2568@.TK2MSFTNGP10.phx.gbl...
> Hey all,
> I'm connecting to SqlServer 2000 from an ASP.NET web application.
> The web application runs under a specific Identity (impersonating to a
> specific windows account), the connection string contains
> "IntegratedSecurity=SSPI",
> and as far as I can see, it (the connection string) is constant.
> Will my web application be using the connection pooling mechanism? I'm
> asking this because I've been reading that if the conenction string
> is constant, the connection pool will be used, however, I haven't found
> anything about windows authentication, where the username and password
> aren't specified in the connection string, but are managed by windows,
> therefore I can't really say if the connection srting is different or not.
> Thanks, Gai.
>|||Yes, but again, I'm impersonating a single user (not the running user, but
DomainA\UsernameA).
Hope it's more clear now.
Thanks any way, Gai.
"Marc Mertens" <marc.mertens@.azlan.com> wrote in message
news:eGpFc6s0EHA.1260@.TK2MSFTNGP12.phx.gbl...
> As far as I know, if you create a connection to the sql server and then
> impersonate a new user and make a new connection, a new connection pool
gets
> created even if the connection string is the same.
> Hopes this helps
> Marc
> "Gai" <gaitamir@.IBezint> wrote in message
> news:#otPhYh0EHA.2568@.TK2MSFTNGP10.phx.gbl...
not.[vbcol=seagreen]
>sqlsql
connection pooling
Is there a way to enable connection pooling with SQL Server 2005 with ADO,
OLEDB ? (from c++, not .net)
If client is connecting with the same connection string pooling is
automatically created?
thanksConnection Pooling is implemented by the .NET provider or the OLEDB
provider. AFAIK, the OLEDB provider turns this on by itself. My question is:
why are you using OLE DB to access SQL Server?
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
----
---
"Andy" <kc2ine@.yahoo.com> wrote in message
news:eEXb6EPIIHA.4296@.TK2MSFTNGP04.phx.gbl...
> Hi,
> Is there a way to enable connection pooling with SQL Server 2005 with ADO,
> OLEDB ? (from c++, not .net)
> If client is connecting with the same connection string pooling is
> automatically created?
> thanks
>
connection pooling
Is there a way to enable connection pooling with SQL Server 2005 with ADO,
OLEDB ? (from c++, not .net)
If client is connecting with the same connection string pooling is
automatically created?
thanks
Connection Pooling is implemented by the .NET provider or the OLEDB
provider. AFAIK, the OLEDB provider turns this on by itself. My question is:
why are you using OLE DB to access SQL Server?
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"Andy" <kc2ine@.yahoo.com> wrote in message
news:eEXb6EPIIHA.4296@.TK2MSFTNGP04.phx.gbl...
> Hi,
> Is there a way to enable connection pooling with SQL Server 2005 with ADO,
> OLEDB ? (from c++, not .net)
> If client is connecting with the same connection string pooling is
> automatically created?
> thanks
>
Connection Pool in SQLserver 2005
a sqlserver 2005 using windows identity.
We are planning an application where the users windows identity is forwarded
through all layers all the way into the sqlserver.
This gives security and auditing advantages.
But a pros/cons evaluation is always proper to do.
The cons include: the sqlserver connection pool cannot be used...(?) If
there is more problems, pls let me know.
This rises the question: what is the price for not using connection pools.
Who is paying: the sqlserver or the business layer on the IIS server or both?
regards
Jens Chr
If the users are constantly in/out of the server, you can still benefit from
using connection pooling. It's just that each user will have their own
connection pool. (Set the max connections in the pool to 2, and set the pool
timeout up to 10-20 minutes -or longer.)
Of course, this will require a bit more memory on the IIS box, and a bit
more on the SQL Server, but will greatly improve responsiveness.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"jcjj" <jcjj@.discussions.microsoft.com> wrote in message
news:CD85E9F3-21BE-42B6-AC23-EDBF0234C713@.microsoft.com...
> What is the performance cost of not using connection pool when connecting
> to
> a sqlserver 2005 using windows identity.
> We are planning an application where the users windows identity is
> forwarded
> through all layers all the way into the sqlserver.
> This gives security and auditing advantages.
> But a pros/cons evaluation is always proper to do.
> The cons include: the sqlserver connection pool cannot be used...(?) If
> there is more problems, pls let me know.
> This rises the question: what is the price for not using connection pools.
> Who is paying: the sqlserver or the business layer on the IIS server or
> both?
> regards
> Jens Chr
Connection Pool in SQLserver 2005
a sqlserver 2005 using windows identity.
We are planning an application where the users windows identity is forwarded
through all layers all the way into the sqlserver.
This gives security and auditing advantages.
But a pros/cons evaluation is always proper to do.
The cons include: the sqlserver connection pool cannot be used...(?) If
there is more problems, pls let me know.
This rises the question: what is the price for not using connection pools.
Who is paying: the sqlserver or the business layer on the IIS server or both
?
regards
Jens ChrIf the users are constantly in/out of the server, you can still benefit from
using connection pooling. It's just that each user will have their own
connection pool. (Set the max connections in the pool to 2, and set the pool
timeout up to 10-20 minutes -or longer.)
Of course, this will require a bit more memory on the IIS box, and a bit
more on the SQL Server, but will greatly improve responsiveness.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"jcjj" <jcjj@.discussions.microsoft.com> wrote in message
news:CD85E9F3-21BE-42B6-AC23-EDBF0234C713@.microsoft.com...
> What is the performance cost of not using connection pool when connecting
> to
> a sqlserver 2005 using windows identity.
> We are planning an application where the users windows identity is
> forwarded
> through all layers all the way into the sqlserver.
> This gives security and auditing advantages.
> But a pros/cons evaluation is always proper to do.
> The cons include: the sqlserver connection pool cannot be used...(?) If
> there is more problems, pls let me know.
> This rises the question: what is the price for not using connection pools.
> Who is paying: the sqlserver or the business layer on the IIS server or
> both?
> regards
> Jens Chrsqlsql
Tuesday, March 20, 2012
connection or user limitation
rprise SQL server. I want to understand the limitation on MSDE, it is 5 concurrent users or 5 concurrent connections and there is a difference because the ISAPI dll uses the same user login. Actually, the is one user connecting to SQL server via DLL, but
multiple copies of the dll can be loaded and each copy makes its own database connection.
> it is 5 concurrent users or 5 concurrent connections
Neither, it is 5 concurrent workloads.
You can have 40 or 100 connections and not trigger the governor, until so
much work is attempted by so many users *at the same time.* Remember that a
lot of the time that a connection stays open, it is idle, so it not pushing
the workload limit.
Please read:
http://msdn.microsoft.com/library/en...r_sa2_0ciq.asp
http://www.aspfaq.com/
(Reverse address to reply.)
Connection Mystery
public void Page_Load( object s, EventArgs e ) {
SqlConnection conn = new SqlConnection( "Server=server;User ID=user;Password=pass;" );}
conn.Open();
and I get the following error:
System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.
Thisworks for other server/user/pass except the one I am having troublewith. The SQL Server is using SQL & Windows Authentication. I amable to connect from the machine that is running the webserver viaosql, ODBC, and MS Access using the same arguments (server, user, andpass), so I know that the SQL server does exist, and the User/Passwordshould give me access.
Does anyone have any ideas why thisisn't working or what ASP.NET is does differently from the other accessmethods? Any ideas are greatly appreciated.
Thanks,
Mark Daneyou havent specified what database to connect to..check out thiswebsite for connection strings|||I have tried it with and without using a database name in theconnection string. It does not work either way.
I have tried a variety of connection strings options but none of thecombonations seem to work. However they work connecting to adifferent SQL Server, which makes me think that it is something withthis specific SQL Server. However I am able to connect to theserver through osql, ODBC, or MS Access all without a problem, so Idon't belive it is a problem with the SQL Server accepting the login.Since it doesn't seem to be a problem with the connection stringattributes, or the server, I am not sure what could be causing it.
|||are you sure you have the values properly like the server name, database name uid, pwd all correct ? and can you connect to the sql server from query analyzer using the same credentials ?|||
Try this url for the database permissions setup, if no money transactions passes through the site. Hope this helps.
http://duhnetnuke.net/DesktopDefault.aspx?tabid=40
Kind regards,
Gift Peddie
|||The info in this link uses the Master as the default database for your Asp.net account permissions. If you are still having problems with that, then it could be a bug. Hope this helps.
http://duhnetnuke2.net/Default.aspx?tabid=64
|||I found out what the problem was. The SQL Server I was trying toconnect to didn't have the latest service pack installed. Iupgraded the SQL Server to SP3a and now it works fine.Connection managers - OLE DB
Quick question.In DTS when you had multiples tasks connecting to the same Database, it was reccomended that you create multiple connections for the same database and let each task use a different connection, thereby making a new connection for each one.
In SSIS if i define 1 OLE DB connection to a database, but i have say 6 tasks using that connection that run simultaneously, does eachone open a new connection to the database to make it more efficient? Or do i still need to define multiple connections to the same database and assign each task a different connection?
Thanx
SeanDL wrote:
Hi There Quick question.In DTS when you had multiples tasks connecting to the same Database, it was reccomended that you create multiple connections for the same database and let each task use a different connection, thereby making a new connection for each one.
In SSIS if i define 1 OLE DB connection to a database, but i have say 6 tasks using that connection that run simultaneously, does eachone open a new connection to the database to make it more efficient? Or do i still need to define multiple connections to the same database and assign each task a different connection?Thanx
Sean,
In that situation each of the 6 tasks will use the same connection as far as I know. I guess this is why the connection managers are so called - its because they manage a single connection thereby enabling many tasks to use it.
I'm no DBA but I suspect that this is more efficient than opening multiple connections.
-Jamie|||Hi Jamie
In DTS it was definately better to use multiple connections when extracting large amounts of data from each connection.But no mention has been made of it in SSIS, i guess i could do some tests myself to see if it helps performance?
Thanx|||I'd be interested in seeing any metrics you get.
I don't claim to know much about DTS but I suspect that there are different reasons that multiple connections are recommended that outweigh the benefit of only having 1 connection to the server.
I also suspect that even if one connection object were used each task that used it would still have its own connection (I stand to be corrected here). This is not the case with SSIS.
-Jamie|||Sean, the reason connection managers are called that is to distinguish them from connections as named in DTS. The reason it was recommended to use multiple connections in DTS is because workflow would be serialized if pointing to the same connection. Connection managers actually generate a new connection everytime you call AcquireConnection so the workflow isn't serialized. Each task or transform etc. that calls AcquireConnection on the connection manager receives a new physical connection.
So, for SSIS, just use one connection manager. Also, consider using Data Sources and Data Source views for your OLEDB connections. I blogged about it a bit recently. That simplifies matters even more and makes your packages that much more portable.
Thanks,|||Kirk,
Right then, I'm a wee bit confused. I'll tell you why.
I was recently working on a package where I had an Execute SQL Task followed by a data-flow which extracted from a SQL Server DB. Both tasks used the same connection manager.
In the Execute SQL Task there was a SET ROWCOUNT 20000 statement. When I ran the package, the data-flow only processed 20000 rows - obviously because it was affected by the SET ROWCOUNT command in the previous task.
Now, if both tasks had seperate connections that wouldn't happen. Or would it? I've done a quick scan of google to find out if I could find out the scope of SET ROWCOUNT but couldn't find anything (and its getting late :)
Any ideas?
-Jamie|||Hi Kirk
Thanx for the info, that is what i thought but i just could not find any documentation to verify it.
Although Jamies issue is a bit worrying because set rowcount's scope is definately within a connection/transaction?
Thanx|||Hi Kirk
Ok i am also still confused, my concurrent connections (5 of them) using the same conenction manager we all executing in parrellel, then i changed the connection manager to use the OLE DB for SQL Server NOT the native client that iw as using), now only 3 of the 5 tasks execute concurrently when 1 finishes the next one starts.Therefore it seems only 3 concurrent conenctions are allowed, i have checked BOL , but i cannot find where this setting is as i would like all tasks to run in parallel, if you know it would be greatly appreciated.
Thanx|||Check the MaxConcurrentExecutables property of the package by clicking on the package design surface and then looking at the properties. If it's set to -1, the heuristic used to determine max executables is n+2, where n is the number of processors.
Change it to a higher number and watch them all fly together. :)
K|||Thanx Kirk
Spot on , i did see that setting but i thought -1 was unlimited.Thanx A million works like a bomb !|||
Jamie Thomson wrote:
Kirk,
Right then, I'm a wee bit confused. I'll tell you why.I was recently working on a package where I had an Execute SQL Task followed by a data-flow which extracted from a SQL Server DB. Both tasks used the same connection manager.
In the Execute SQL Task there was a SET ROWCOUNT 20000 statement. When I ran the package, the data-flow only processed 20000 rows - obviously because it was affected by the SET ROWCOUNT command in the previous task.Now, if both tasks had seperate connections that wouldn't happen. Or would it? I've done a quick scan of google to find out if I could find out the scope of SET ROWCOUNT but couldn't find anything (and its getting late :)
Any ideas?
-Jamie
OK, I've just built a simple mock-up to demo this and lo and behold it doesn't happen anymore. Setting rowcount in the Excute SQL Task didn't affect the dataflow.
I swear that when I did this before though it DID affect the data-flow...and I have witnesses to prove it. It occurred on April CTP whereas I am now using June CTP. perhaps that's why!!!
For now, ignore this. If it happens again I'll raise it.
Weird!!
-Jamie|||Did you have retain same connection set to true?
I don't have a good answer here. Without looking at the package, it's hard to know for sure.|||Yes, did so myself. Couldn't repro it either...
connection manager losing credentials
On my SSIS package I have 2 connection managers, both are connecting to an Oracle db. I enter in the ID and Password then click 'test connection' I'm able to connect to the database fine. I then go to a data flow of one of my control flow task. Open up my OleDb Source and click preview. The SQL query executes with no issues. I can see the data from my connection manager source.
I then go and run the package and I get this error message:
[OLE DB Source [1]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "OracleConnection" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
I've been racking my brain on this for a few days and still no luck on getting this to work.
You probably have the 'protection level' property of the package set to 'dontsavesensitive'. You could either change this to 'encryptsensitivewithuserkey' or set the password property of the connection manager through a configuration.
|||I've done both, changed the package property and tried a config file and I get the same results.
|||Enable package logging, or if you are using BIDS, check the progress tabs and see if you any warning about package configurations.Package configuration should solve the problem. This KB article has some related info:
http://support.microsoft.com/kb/918760|||
I got it working actually now, well sort of.
I had to remove all of my connection managers, close down BIDs open it back up, add new connection managers, change the package property setting again and it work.
Now I'm running into another issue
I have one package (dtsx file) that calls other dtsx file (all within the same solution) and its unable to connect to the packages it needs to call, though all the packages are in the same solution and the same database
|||Please provide more details:How are you running the packages (BIDS, DTEXEC, etc)?
Where are the packages stored?
Error messages?|||
I'm trying to run it in BIDS right now and I get this error message:
Error: Error 0xC0012050 while preparing to load the package. Package failed validation from the ExecutePackage task. The package cannot run. .
If I deploy them to my SQL server and try to execute it from there (right click, execute), I'm getting this error message:
Error: Error 0xC0012050 while preparing to load the package. Package failed validation from the ExecutePackage task. The package cannot run. .
and I list of warnings saying it can't find the connection manager and so on.
|||You have a problem here. If you remove a connection manager; you need to go to every single place where that connection manager was being referenced and provide a new/valid connection manager.The message you are getting indicates that the package failed validation; that means SSIS won't even try to run it. You need to remove all the references to that connection manager(s) you deleted.|||
This is driven my insane.
I can now run the SSIS package in BIDS, but I get the error:
'the acquireconnection method call to the connection manager 'oracle' has failed
and I've removed all of the connection managers used and created new ones and I still get the above error on my SQL server
Monday, March 19, 2012
Connection Issues with Oracle Data Source
database. The error we get is ORA 12154 - Cannot create a connection to data
source. This issue only occurs on the Report Server and not in the
development environment.
This is an intermittent problem although it occurs more often than not.
Some individuals never have any issues while others have it with a high
degree of frequency.
We have tried recreating the data source, using both a Shared Data Source
and a direct data source with no change in the problem.
Can anyone shine some light on this issue?I am getting the same kind of error. It is very strange. I have 2
ReportServers running on a 2000 machine and a 2003 machine. The 2000 machine
runs every report great, but on 2003 I get random conneciton errors like you
do. I would love to know why this is happening, and if this is a known
issue. Thanks.
"Marty" wrote:
> We are getting a recurring connection problem when connecting to an Oracle 9i
> database. The error we get is ORA 12154 - Cannot create a connection to data
> source. This issue only occurs on the Report Server and not in the
> development environment.
> This is an intermittent problem although it occurs more often than not.
> Some individuals never have any issues while others have it with a high
> degree of frequency.
> We have tried recreating the data source, using both a Shared Data Source
> and a direct data source with no change in the problem.
> Can anyone shine some light on this issue?|||I'm having similar problems however it seems as if some clients never have
issues while others do. We are trying to get the reports setup for our
helpdesk staff to use, however they have problems running reports that
communicate to Oracle.
We've tried everything, however nothing seems to keep it consistent.
"Marty" wrote:
> We are getting a recurring connection problem when connecting to an Oracle 9i
> database. The error we get is ORA 12154 - Cannot create a connection to data
> source. This issue only occurs on the Report Server and not in the
> development environment.
> This is an intermittent problem although it occurs more often than not.
> Some individuals never have any issues while others have it with a high
> degree of frequency.
> We have tried recreating the data source, using both a Shared Data Source
> and a direct data source with no change in the problem.
> Can anyone shine some light on this issue?
connection issues when running multiple instances of same application
I am running multiple instance of the same application. This application is connecting to the database and running stored procedures using ADODB (all code examples are taken from msado15).
The problem is that somehow these two applications are sharing something either with the connection or commands.
For instance if the two instances are in the following function at the same time then they both thow an SEH exception:
Code Snippet
inline _RecordsetPtr Command15::Execute ( VARIANT * RecordsAffected, VARIANT * Parameters, long Options ) {
struct _Recordset * _result = 0;
HRESULT _hr = raw_Execute(RecordsAffected, Parameters, Options, &_result);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return _RecordsetPtr(_result, false);
}
The exception that occurs is: "First-chance exception ...: 0xC0000005: Access violation reading location 0x00000068."
And afterwords when they go to release the command an error occurs on
First-chance exception at 0x4de4120c in IpsEngine.exe: 0xC0000005: Access violation reading location 0xcccccccc.
Code Snippet
inline void _bstr_t::Data_t::_Free() throw()
{
if (m_wstr != NULL) {
::SysFreeString(m_wstr);
}
if (m_str != NULL) {
delete [] m_str;
}
}
This is being called from.
Code Snippet
inline void Command15::PutRefActiveConnection ( struct _Connection * ppvObject ) {
HRESULT _hr = putref_ActiveConnection(ppvObject);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}
The exception that occurs: First-chance exception at ...: 0xC0000005: Access violation reading location 0xcccccccc.
Similarly when one instance releases a command using
Code Snippet
inline void Command15::PutRefActiveConnection ( struct _Connection * ppvObject ) {
HRESULT _hr = putref_ActiveConnection(ppvObject);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}
The second instance of the application fails when running the command at the exact same time.
Code Snippet
inline _RecordsetPtr Command15::Execute ( VARIANT * RecordsAffected, VARIANT * Parameters, long Options ) {
struct _Recordset * _result = 0;
HRESULT _hr = raw_Execute(RecordsAffected, Parameters, Options, &_result);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return _RecordsetPtr(_result, false);
}
The command and connections are not static and there should be completely seperate instances of these for each instance of the application. Does anybody know why this may be happening. Any help would be appreciated. Thanks in advance.
All of these access issues are with pointers being passed into these functions. As such, we don't have much context with which to help you with these issues. Any issue could be causing these problems including: double freeing, not allocating memory elsewhere or failure to properly initialize memory, failure to check return codes of functions that return memory, etc. In these cases, we need to see the context surrounding the variables that are causing the AV, in for example: for Command15::Execute, RecordsAffected and Parameters would be the variables of interest, we would need to see how they are allocated, initialized, and used prior to this function call in the execution context of a failure, and how they are allocated, initialized, and used prior to this function call in the execution context of success. The most likely cause of this AV is failure to handle error conditions coming back from functions that allocate memory on success.
Thanks,
John
|||But when I run only one instance of the application at a time it works fine, I have been running it already for a long time and never had a problem. How is it that running two seperate instances of the application could cause this error. The memory allocation would not change just because there are two instances? would it?
connection issues when running multiple instances of same application
I am running multiple instance of the same application. This application is connecting to the database and running stored procedures using ADODB (all code examples are taken from msado15).
The problem is that somehow these two applications are sharing something either with the connection or commands.
For instance if the two instances are in the following function at the same time then they both thow an SEH exception:
Code Snippet
inline _RecordsetPtr Command15::Execute ( VARIANT * RecordsAffected, VARIANT * Parameters, long Options ) {
struct _Recordset * _result = 0;
HRESULT _hr = raw_Execute(RecordsAffected, Parameters, Options, &_result);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return _RecordsetPtr(_result, false);
}
The exception that occurs is: "First-chance exception ...: 0xC0000005: Access violation reading location 0x00000068."
And afterwords when they go to release the command an error occurs on
First-chance exception at 0x4de4120c in IpsEngine.exe: 0xC0000005: Access violation reading location 0xcccccccc.
Code Snippet
inline void _bstr_t::Data_t::_Free() throw()
{
if (m_wstr != NULL) {
::SysFreeString(m_wstr);
}
if (m_str != NULL) {
delete [] m_str;
}
}
This is being called from.
Code Snippet
inline void Command15::PutRefActiveConnection ( struct _Connection * ppvObject ) {
HRESULT _hr = putref_ActiveConnection(ppvObject);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}
The exception that occurs: First-chance exception at ...: 0xC0000005: Access violation reading location 0xcccccccc.
Similarly when one instance releases a command using
Code Snippet
inline void Command15::PutRefActiveConnection ( struct _Connection * ppvObject ) {
HRESULT _hr = putref_ActiveConnection(ppvObject);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
}
The second instance of the application fails when running the command at the exact same time.
Code Snippet
inline _RecordsetPtr Command15::Execute ( VARIANT * RecordsAffected, VARIANT * Parameters, long Options ) {
struct _Recordset * _result = 0;
HRESULT _hr = raw_Execute(RecordsAffected, Parameters, Options, &_result);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return _RecordsetPtr(_result, false);
}
The command and connections are not static and there should be completely seperate instances of these for each instance of the application. Does anybody know why this may be happening. Any help would be appreciated. Thanks in advance.
All of these access issues are with pointers being passed into these functions. As such, we don't have much context with which to help you with these issues. Any issue could be causing these problems including: double freeing, not allocating memory elsewhere or failure to properly initialize memory, failure to check return codes of functions that return memory, etc. In these cases, we need to see the context surrounding the variables that are causing the AV, in for example: for Command15::Execute, RecordsAffected and Parameters would be the variables of interest, we would need to see how they are allocated, initialized, and used prior to this function call in the execution context of a failure, and how they are allocated, initialized, and used prior to this function call in the execution context of success. The most likely cause of this AV is failure to handle error conditions coming back from functions that allocate memory on success.
Thanks,
John
|||But when I run only one instance of the application at a time it works fine, I have been running it already for a long time and never had a problem. How is it that running two seperate instances of the application could cause this error. The memory allocation would not change just because there are two instances? would it?