We have an .net standalone(windows) application which connects to SQL AnyWhere (Sybase) using ODBC connection. In this application fist we create temporary tables and then we push the data from these temporary tables to the actual production tables. This is the overview of my application.

We have tab delimited text files using which we create the tables and insert the data to database. I am creating these tables and inserting the data to the tables from .net application(using odbc). what happens is for sometime the application is running perfectly fine its creating the tables and inserting the data to temp tables , but after sometime am getting an error as ERROR [08001] [Sybase][ODBC Driver][SQL Anywhere]Database server not found. This is happening on the production server only. Am not receiving these errors when am testing or running the code locally.

Am really frustrated with this not getting any of the solutions . Please any one of you can guide me on this issue and let me know the possibilities or work around

Regards, Satish


asked 21 Aug '13, 09:43

Satish%20Panithi's gravatar image

Satish Panithi
91447
accept rate: 0%

Which version of SQL Anywhere are you using?

We have an .net standalone(windows) application which connects to SQL AnyWhere (Sybase) using ODBC connection.

Is there a particular reason that you are not using the ADO.NET driver? It should have better performance for you from .NET:

http://dcx.sybase.com/index.html#sa160/en/dbprogramming/adodotnet-development.html

what happens is for sometime the application is running perfectly fine its creating the tables and inserting the data to temp tables , but after sometime am getting an error as ERROR [08001] [Sybase][ODBC Driver][SQL Anywhere]Database server not found.

This will be the message returned back to the database client. Is the database server still running after you receive this error, or did it stop/crash?

On the database server, enable the console log file to record the information when the client gets disconnected: (e.g. dbsrv16 -z -o console.txt ...) to see what happens on the server-side when you receive this error.

(21 Aug '13, 10:21) Jeff Albion

First of all Thanks Jeff Albion for your reply. Below 1.We are using sqlanywhere11. 2.And we do have database profiles created in ODBC Administrator that is the reason we are using ODBC. 3.Database server is in running mode when we receive this error i mean its not crashing or stopping.

Please advice

(21 Aug '13, 11:02) Satish Panithi

And one more as i said earlier am creating and inserting these tables using flat/tab-delimited text files. Am getting this error for specific tables only. I mean how many times I run the application am getting this database server not found issue for specific tables only. Is this anyway related to the text files or related to the server.

(21 Aug '13, 11:10) Satish Panithi
Replies hidden

Am getting this error for specific tables only. I mean how many times I run the application am getting this database server not found issue for specific tables only.

Can you post some sample .NET code of how you are trying to insert the data files from your application?

How are you creating/maintaining connections to SQL Anywhere from your .NET program?

2.And we do have database profiles created in ODBC Administrator that is the reason we are using ODBC.

The ADO.NET provider can also refer to ODBC entries in order to obtain the connection information in its connection string. (e.g. Data Source=SQL Anywhere 11 Demo).

(21 Aug '13, 14:46) Jeff Albion
Comment Text Removed

below is the code for inserting data am passing the insert query in sqlstring. if (sqlString != string.Empty) { oDBHelper.ExecuteNonQuery(CommandType.Text, sqlString); sb = new StringBuilder(); sqlString = string.Empty; }

execute non query to open and insert data

public int ExecuteNonQuery(CommandType cmdType, string cmdText) { try {

            EstablishFactoryConnection();
            PrepareCommand(false, cmdType, cmdText);
            int val = oCommand.ExecuteNonQuery();
            return val;

        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            if (null != oCommand)
                oCommand.Dispose();
            CloseFactoryConnection();
        }
    }

Below is the connection to open database.

public void EstablishFactoryConnection() { / // This check is not required as it will throw "Invalid Provider Exception" on the contructor itself. if (0 == DbProviderFactories.GetFactoryClasses().Select("InvariantName='" + S_PROVIDER + "'").Length) throw new Exception("Invalid Provider"); / oConnection = oFactory.CreateConnection();

        if (oConnection.State == ConnectionState.Closed)
        {
            if (utils != null)
            {
               oConnection.ConnectionString = utils.DBMgr.ConnectionStr;
               oConnection.Open();
               oConnectionState = ConnectionState.Open;
            }
        }
    }
(22 Aug '13, 01:23) Satish Panithi
Replies hidden

Thank you for posting the .NET portion - although, this unfortunately is not enough information to be illustrative of the problem. When we ask for customers to post sample code, the idea is that we can take the sample code and easily run it on another installation to see the same issue. Currently, this code does not contain the following auxiliary information needed to reproduce an issue:

  1. The SQL string (sqlstring) you're using to insert data with.
  2. The connection string (utils.DBMgr.ConnectionStr) you're using.
  3. How the data is actually populated from this application, and the details of the tables that are specifically failing in your tests.

Also, which specific build of SQL Anywhere 11 are you using for both the database server and the ODBC driver? (e.g. 11.0.1.2960).

// This check is not required

If the code is currently commented out and not required to reproduce the issue, it is best to remove the section before posting to avoid confusion.


If this code works in general (on your local machine) and if you only require direct assistance with a certain network environment that doesn't work, it would likely better to open a technical support case, so we can assist with collecting the specific details of what you're trying when you see this error message.

(23 Aug '13, 08:06) Jeff Albion

Client debug logging might be helpful. Add LogFile=<filespec> to the connection parameters for the problematic connections. This should provide more detail of the cause.

(23 Aug '13, 16:31) Chris Keating
More comments hidden
showing 4 of 7 show all flat view
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×127

question asked: 21 Aug '13, 09:43

question was seen: 4,041 times

last updated: 23 Aug '13, 16:31