cancel
Showing results for 
Search instead for 
Did you mean: 

SAConnection block

09-27-2012 10:19 AM
3540 views 6 comments
SAP Managed Tags
Subscribe

Hello,

Here my configuration : Visual Studio 2010 ASP.NET 4.0 C# SQL Anywhere Version=12.0.1.37694

When I launch a simple pages on debug mod whith this code, SAConnection block and other code cant be executed. My webpage is pending like i have insert a breakpoint on the .SAConnection. But there is no breakpoint. No information in the output windows.

My web.config : <add assembly="iAnywhere.Data.SQLAnywhere.v4.0, Version=12.0.1.37694, Culture=neutral, PublicKeyToken=F222FC4333E0D400"/>

My code :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using iAnywhere.Data.SQLAnywhere;
using System.Configuration;

public partial class test : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        SAConnection conn = new SAConnection("UserID=dba;Password=sql;DataSourceName=demo");

        Label1.Text = "Don' work";
    }
}

Accepted Solutions (0)

Answers (2)

Answers (2)

MCMartin
Participant
0 Likes

Add a try catch around it probably you get an exception which is not catched, so your next statement will never execute. Another possible problem which comes to my mind is, that your webpage eventually is not finding all needed assemblies (e.g. for the SA... classes iAnywhere.Data.SQLAnywhere) this will only be identified during load of the page.

regdomaratzki
Product and Topic Expert
Product and Topic Expert
0 Likes

Lets try and figure out if the problem is with the database engine layer or the .NET layer.

When the code is blocked, if you make another connection to the database engine with dbisql, if you execute sa_conn_info() and sa_locks(), can you see any blocked connections in the database engine that might explain why the new SAConnection() is blocked? You can post the output here if you're not sure how to interpret the results.

Former Member
0 Likes

Thank for your answer.

When the SAConnection() is blocked, i have launch SELECT * FROM sa_conn_info(). Here the result :

Number,Name,Userid,DBNumber,LastReqTime,ReqType,CommLink,NodeAddr,ClientPort,ServerPort,BlockedOn,LockRowID,LockIndexID,LockTable,UncommitOps,ParentConnection 6,'SQL_DBC_505c8d50','DBA',0,'2012-09-27 18:22:18.215','FETCH','local','',0,0,0,0,,'',0, 1,Sybase Central 1,DBA,0,2012-09-27 18:22:15.173,CLOSE,local,,0,0,0,0,(NULL),,0,(NULL)

When I launch select * from sa_locks() there is no result.

additionnal information : I am on windows 7 64 bits with Visual studio 2010 32 bits. (I have install SA 32 and 64 bits).

best regards,

Former Member
0 Likes

Other aditionnal information. If I enter wrong information on the SAConnection, for exemple :

SAConnection conn = new SAConnection("nothing");

I have the same problem.

best regards,

VolkerBarth
Contributor
0 Likes

This does obviously mean that the problem is not a blocking issue in SQL Anywhere, as your SQL Central connection is the only one currently connected, so your web page code has not connected at all or is already disconnected...

jeff_albion
Product and Topic Expert
Product and Topic Expert
0 Likes
  • How do you define the DSN "Demo"?
  • Is this a User DSN or a System DSN?
  • Is this a 32-bit or 64-bit Operating System running IIS?
  • Is it a 32-bit DSN or 64-bit DSN?
  • Can you run the ODBC admistrator and "Test" the DSN connection to ensure it connects to the database server?