0
votes

sometimes I got the below error when trying to open connection to sybase using ase client

Connection to Sybase server has been lost. All active transactions have been rolled back Stack Trace : at Sybase.Data.AseClient1.AseCommand.CheckResult(Int32 res) at Sybase.Data.AseClient1.AseCommand._ExecuteReader(CommandBehavior commandBehavior) at Sybase.Data.AseClient.AseCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)

I am using dll Sybase.AdoNet2.AseClient (64 bit) version 2.155.1015.0

my code is as follows

AseConnection Connection = new AseConnection("ConnectionString");
AseCommand Command = new AseCommand("StoredProcedure", Connection);
Command.CommandType = CommandType.StoredProcedure;
AseDataAdapter adapter = new AseDataAdapter();
DataSet ds = new DataSet();
adapter.SelectCommand = Command;
adapter.MissingSchemaAction = SchemaAction;
adapter.Fill(ds);

this code run under IIS web service

search does not lead to something useful, what I get is this link, but with no help

1
How long doe's the query take? it might be a TimeOut issue. AseCommand.CommandTimeout to set timeout.christiandev
Another idea to do with commiting transactions, none are one left open are they?Jeremy Thompson
the called stored takes less than 1 second when run with the same parameters in DBAritisanmfarouk
the procedure mainly fill a temp table and then make some calculations and update it, the procedure don't call begin tran or commitmfarouk

1 Answers

0
votes

couldn't find any solution for this defect or the root cause of this, so i developed just catched this exception and then retried the connection and command execution