This is a migrated thread and some comments may be shown as answers.

Error 226: OpenAccess Error: Unable to reach database server on host

5 Answers 405 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Devtron
Top achievements
Rank 1
Devtron asked on 08 Sep 2009, 10:29 PM
Hello,

I am building an installation package/deployment project. Everything works great in development and testing.

Whenever I change my app.config settings to point to the production database & server, I get the following error:

Error    226    OpenAccess Error: Unable to reach database server on host 'vmdbprod\vmdbprod2005'.
Error Details:Unable to connect to Backend=mssql;Server=xxxx\xxx;Database=xxxx;Driver=;Integrated Security=False;;USER=Ixxxx;;ConnectOnly=true;:
Telerik.OpenAccess.RT.sql.SQLException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.DBDriver.connect(String url, IDictionary driverProps)
   at OpenAccessRuntime.Relational.conn.RelationalConnectionPool.createRealCon()
DBDriver: Telerik.OpenAccess.RT.Adonet2Generic.Impl.DBDriver
LOCK_TIMEOUT=5000
Please ensure that the hostname provided is valid and resolvable, verify that the machine is reachable in your network and that a database server is running on that machine. 



My question is, how can I deploy this project, with database settings that I do not have access to? This is going onto our client's network (scheduled for tomorrow) and I am unable to build my project when pointed to their network.

How can I bypass this or ignore this error? Why must ORM authenticate itself like this? not good!

5 Answers, 1 is accepted

Sort by
0
IT-Als
Top achievements
Rank 1
answered on 09 Sep 2009, 07:23 AM
Hi Devtron,

This might seem trivial:

But have you ensured that your the database instance (Sql configuration) on the remote server allows tcp/ip communications. Default it is disabled.

Regards

Henrik
0
PetarP
Telerik team
answered on 09 Sep 2009, 04:15 PM
Hi Devtron,

What Henrik pointed is usually the main cause of the issue you are facing. Unfortunately there is no way to bypass that but to enable the server on the targeted machine to accept tpc/ip connections. To do so, you will have to open the SQL Server Configuration Manager. There you should locate the protocols that are enabled for the server and check if the TCP/IP is enabled. If it is not, please enable it manually.


Regards,
Petar
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Dilshod
Top achievements
Rank 1
answered on 02 Dec 2013, 11:59 AM
Hi,
I am having the similar issue here. I have many test cases and every time several tasks will fail when I try running them all at the same time. Failing test cases aren't random all the time. To fix the problem I need to run each failed test individually. Running them individually works fine. I am opening connection to the database at test Setup.

Thanks,
0
Wolfgang
Top achievements
Rank 1
answered on 03 Dec 2013, 09:00 AM
I think multiple reasons can be teh problem.
When you run the test cases in parallel, are you using multiple telerik connections? (Think about commits as end of a transaction - could they occur in parallel to some other code, like adding a object to a scope. If you have only one connection thinks will fail. )
When you are using multiple telerik connections, how much concurrent connections will try to access the server? Is the server allowed to accept such a numer of connections?
0
Kaloyan Nikolov
Telerik team
answered on 04 Dec 2013, 11:26 AM
Hello Dilshod,

usually the test runners execute the tests in a sequence, which means that if some of your tests cause "connection leak" when the test are executed to a given point the maximum allowed connection by your server will be reached and all tests after this point will fail. This could explain while the failing tests are not random all the time. I would suggest you go trough the tests executed before you see the first failure and check for potential connection leaks.

Such problems could be caused by one of the following cases:

1. using the low-level ADO API without using blocks or explicit Close()/Dispose() for the obtained OaConnection:
var con = dbContext.Connection;
//do something here
//this should be:
using(var con = dbContext.Connection)
{
     //do something here
}

2. You are using Domain Methods without committing the transaction:
var res = dbContext.CallMyStoredProcedure();
 
//better implement it like this:
try
{
  var res = dbContext.CallMyStoredProcedure();
}
finally
{
  //This will commit the transaction and will free the connection;
  db.SaveChanges();
}

3. The OpenAccessContext is not disposed at the end of the TestMethod/TestClass, you could do something like this:
[TestInitialize]
public void TestInit()
{
  this.dbContext = new EntitiesModel();
}
 
[TestCleanup]
public void TestCleanup()
{
  if( this.dbContext  != null)
  {
     this.dbContext.Dispose();
     this.dbContext = null;
  }
}

If those hints doesn't help you to locate the problem please provide more details about the error you get.


Regards,
Kaloyan Nikolov
Telerik
OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features shipped with our latest release!
Tags
General Discussions
Asked by
Devtron
Top achievements
Rank 1
Answers by
IT-Als
Top achievements
Rank 1
PetarP
Telerik team
Dilshod
Top achievements
Rank 1
Wolfgang
Top achievements
Rank 1
Kaloyan Nikolov
Telerik team
Share this question
or