Home  |  Linux  | Mysql  | PHP  | XML
From:Paul Date:Tue Jul 22 22:04:34 2008
Subject:Re: ExecuteReader hangs and goes 100%CPU when the network cable is unplugged

Please try a newer Provider. 15.0.0.320 is available on the SDK 15.0 ESD#14
release available for
download on the Sybase download site (http://www.sybase.com/downloads)

Check to see if this helps - if the same thing happens please open a tech
support case with sybase.

In the execute state the Provider sends the command and goes into a read
state.
Sounds like there's nothing else to check and the hang occurs. The socket
code might
have some changes in order to determine whether or not network problems have
occurred.

So check the newer Provider and go from there.

Thank you,

-Paul

<fr.deboffles@gmail.com> wrote in message
news:d886bfe7-6096-46b6-a16f-9c12488aa551@a2g2000prm.googlegroups.com...
Hi,
I am making a query using a stored procedure to our Sybase server. The
query I am using can take up to an hour to process before returning
the reader (I have no means to change the server behaviors). If I
unplugged the network cable on my computer while I am in a
ExecuteReader statement the processor goes 100%CPU and the program
hangs. It will only stop when the CommandTimeout occurs (meaning in
the worst case one hour after the event).
I was expecting receiving an exception for the drop of connection.
Can anyone help me ?

I am using Sybase ADO.Net 1.15.50.0 on Windows XP sp2 with
VisualStudio 2005 and .Net 3.5

Here is the code I use to do that:
IDbConnection db_conn = new AseConnection();
db_conn.ConnectionString = "DataSource='172.26.32.15';" +
"Port='5000';" +
"UID='user';" +
"PWD='pass';" +
"ApplicationName='" +
System.Windows.Forms.Application.ProductName + "';" +
"ClientHostName='" + System.Environment.UserName + "';" +
"ClientHostProc='" + System.Environment.UserName + "-" +
System.Windows.Forms.Application.ProductName + "';" +
"EnableServerPacketSize=1;";
try
{
// Open the connection
db_conn.Open();
}
catch (AseException ex)
{
// Handle AseException
}

IDbCommand db_cmd = db_conn.CreateCommand();
db_cmd.CommandText = "my_sp";
IDbDataParameter param = dbCmd.CreateParameter();
param.ParameterName = "@customerid";
param.DbType = DbType.Int32;
param.Value = Convert.ToInt32(1);
db_cmd.Parameters.Add(param);

db_cmd.CommandTimeout = 3600; //1 hour
IDataReader rdr = null;
if (db_conn.State == ConnectionState.Open)
{
try
{
// If I unplug the network cable while executing this line
the CPU goes 100% until the timeout trigger
rdr =
db_cmd.ExecuteReader(CommandBehavior.SequentialAccess);
}
catch (AseException ex)
{
// Handle AseException
}
}
...
...

Thanks,


Navigate in group sybase.public.connectivity.adonet at sever forums.sybase.com
Previous Next


Your recent visits
Re: How to use connection.GetSchema()?
Re: How to use connection.GetSchema()?
Re: Connect to proxy....via proxy
Illegal disk address range
Re: Cannot update null values into ase using AseCommand



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants