sql connection timeout - sql-server

i have my server written with structure map and fluent nhibernate,
when i run my server from my pc and direct him to the db on another server i get a sqlexception that tells me that the timeout expired
this is the message :
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
the line in code that marked on debug is
_transaction = _session.BeginTransaction();
any suggetions?
the db is mssql 2008

First thing to do is make sure you have connectivity to that other database. Open management studio and try to connect.
If that connects, then you need to make sure you have all of your settings setup correctly. Check the web.config and the hibernate.xml file.

Related

JDBC inactivity timeout (MS SQL Database)

On my setup with a JDBC driver that connects to a Microsoft SQL Server 2019 database, I experience the following "connection broken" error if there is more than ~12h inactivity.
The error is:
The connection is broken and recovery is not possible. The connection is marked by the client driver as unrecoverable. No attempt was made to restore the connection.
How to extend that inactivity timeout? Is it a setting of the MSSQL server?
Trying to find an appropriate setting for the JDBC connection. I could not find any.

login fails in first attempt each time in sql server ssms (Login time out expire)

I am facing connection timeout expired error while my first attempt to login in SQL server.
I am able to logged in successfully when I tried to log in again the second time.
SQL server Remote login time out is 20 sec and locks 0.
What was the issue,please help me.
What changes should i do in SSMS for SQL server?
Thanks in advance.
I have check Instance properties remote desktop check.
I have checked SQL server configuration manager in network configurations and it has TCP\IP, Namedpipes,shared memory and VIA is enabled.

intermittent ERROR, Microsoft SQL Server Native Client 11.0 : Named Pipes Provider: Could not open a connection to SQL Server [5]

I have a .vbs script which is carrying out some modelling. This script is fired via a windows scheduled task and performs a fair amount of database selects, inserts and updates.
It has run many times over the years on SQL Server 2008 R2. Its now trying to run on win2016 Server running SQL Server 17.4. The job will run for a couple of hours ideally. Its stopping a little over an hour after almost 10,000 successful inserts, it throws me this error:
Database Error: -2147467259 Microsoft SQL Server Native Client 11.0 : Named Pipes Provider: Could not open a connection to SQL Server [5].
Is this SQL Server taking its resources back for some reason? Any ideas on resolving this would be very helpful?
Update : I have reduced the workload of the script. Instead of running for a couple of hours it now runs for less than one hour. The first two runs have been successful, no issues.
i supose that you try to conect to another server or to the local server across with one computer with network , so check if you have this correct configuration :
enter link description here

SSRS error "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."

I have a SQL Server Reporting Services(SSRS) report which works fine in Visual Studio 2015 report designer version 13.0,1100.286, but once deployed to a report server it keeps throwing the following error:
An error has occurred during report processing. (rsProcessingAborted)
Cannot create a connection to data source 'DummyDataSource'. (rsErrorOpeningConnection)
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
When I attempt to test the connection of the data source in SQL Server Report Builder, I get the same error:
And here is how I set the credentials for my data source. Note that 'myUser' can connect to database 'MyDatabase' in SQL Server Management Studio, and in addition the report works fine in Visual Studio report designer with the same credentials:
I have tried setting the report timeout to 1800 (from initial setting of "Use the system default setting"), but that didn't solve the problem:
I also tried setting the timeout for the data set in the report to 30 and 60 seconds, also with no success. It seems it can't connect to the database at all, because it fails on "Test Connection", before I even attempt to run the report itself.
Any idea why that's happening?
So after much digging and trying everything I came upon while googling this, the answer was the following: recently our IT people added a ton of new IPs to the database server and when a report (on the report server) attempted to connect to the database, it was enumerating all those IPs and was trying to connect to all of them, which resulted in it failing to connect to the right one and hence, the error above.
In order to address this, we added a new DNS entry, mapped solely to the IP address of the database and that finally fixed the issue.
So to summarize, my old connection string (that was trying to connect to all IPs) was:
Data Source=MyDatabase;Initial Catalog=DummyDataSource
The new DNS entry is: sql.MyDatabase.CompanyName.com
And finally, the new connection string that works fine is:
Data Source=sql.MyDatabase.CompanyName.com;Initial Catalog=DummyDataSource

SQL Server Connection Timeout Not working

I've changed the Connection Timeout to 10 seconds.
'...;Connection Timeout=10;..."
The code uses EF 6, .Net 4.5.1.
SQL Server Client has both tcp/ip and Named Pipes enabled.
Disconnected from the Network and then start debugging.
The timeout error happens at the 1 minute mark.
This seems to indicate the error happens when the sql server is not located.
Is SQL Server Ado.net client code is setting the network timeout?
I had thought this was fixed a while ago, like back in 2.0 days.

Resources