From: Oleg U. <ol...@ya...> - 2004-10-14 16:35:34
|
Hello, Carlos! I use Fb.NET provider 1.6 (from CVS at 13.10.2004). Periodically I catch exception: 1) Exception Information ********************************************* Exception Type: System.NullReferenceException Message: Object reference not set to an instance of an object. TargetSite: Void Close() HelpLink: NULL Source: FirebirdSql.Data.Firebird StackTrace Information ********************************************* at FirebirdSql.Data.Firebird.FbConnection.Close() at FirebirdSql.Data.Firebird.FbConnection.Dispose(Boolean disposing) at System.ComponentModel.Component.Dispose() at ... (my stack here) When I try execute this code: FbConnection connection = new FbConnection(ConnectionString); FbCommand command = new FbCommand("\"Test\"", connection); command.CommandType = CommandType.StoredProcedure; // Input parameters command.Parameters.Add("@Hash", FbDbType.Char, 64).Value = Common.ComputeHash(url); command.Parameters.Add("@Id", FbDbType.Integer).Value = id; command.Parameters.Add("@Url", FbDbType.VarChar, 8192).Value = url; // Output parameters FbParameter isFoundParameter = command.Parameters.Add("@IsFound", FbDbType.Integer); isFoundParameter.Direction = ParameterDirection.Output; FbParameter theme1IdParameter = command.Parameters.Add("@Theme1Id", FbDbType.Integer); theme1IdParameter.Direction = ParameterDirection.Output; FbParameter theme2IdParameter = command.Parameters.Add("@Theme2Id", FbDbType.Integer); theme2IdParameter.Direction = ParameterDirection.Output; FbParameter creationTimeParameter = command.Parameters.Add("@CreationTime", FbDbType.TimeStamp); creationTimeParameter.Direction = ParameterDirection.Output; using (connection) { connection.Open(); // I use read-only transaction (procedure Test contains only select commands). command.Transaction = connection.BeginTransaction(FbTransactionOptions.Read | FbTransactionOptions.Wait | FbTransactionOptions.ReadCommitted | FbTransactionOptions.NoRecVersion); command.ExecuteNonQuery(); command.Transaction.Commit(); } P.S. I use connection pooling. |