![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am going to start posting under this topic errors I encounter while developing with the .NET provider. Feel free to comment on any of these errors if you've encountered them before or if you have any advice to offer. I am using a 8.6 server running on a Windows 2000 Server and developing on a Windows XP workstation in Visual Studio .NET 2003 with .NET framework 1.1. ================================================== ========== PROBLEM #1 ========== provider throwing a number of exceptions when using ExecuteNonQuery on different commands. I created two PsqlCommands using the forms designer. One is mapped to a stored procedure and the other to a text statement. Both have parameters (which I had to define in code since the designer, using the collections editor, did not seem to generate any code for them). The text command is executed a number of times in a loop and is associated to a transaction. The stored procudure command is then called to update another table. When I run the commands, I first set their parameters through the parameters collection and then execute them using ExecuteNonQuery. The following behavior occurs: When the commands are run for the first time, they all succeed and the DB tables are updated. The second time through, the text command running in a transaction does not generate errors but PsqlTransaction.Commit() does not write the data to the database. The second command is executed independently of a transaction and throws a PsqlException with the message "Error retrieving error information". Stack trace: at Pervasive.Data.SqlClient.Lna.LnaObject.CheckError( LnaResponse res) at Pervasive.Data.SqlClient.Lna.LnaStatement.Execute( ParamInfoSet pis) at Pervasive.Data.SqlClient.PsqlCommandImpl.execute(B oolean parseOnly, CommandBehavior behavior, Boolean needReader) at Pervasive.Data.SqlClient.PsqlCommandImpl.doExecute NonQuery() at DDInt.Common.CommonCommandImpl.ExecuteNonQuery() at Pervasive.Data.SqlClient.PsqlCommand.ExecuteNonQue ry() at KeywordCleaner.MainForm.btnFind_Click(Object sender, EventArgs e) Here are the Psql trace entries: First time succeeds: -------------------- 00000001 15:53:41.116 T1 I00032 Command::ExecuteNonQuery ENTER CommandText: {call KeywordCleanup_MakeList(?)} CommandType: StoredProcedure CommandTimeout: 30 Par #1: , Input, Default, Default, System.String, "{E5C4D9DD-B79E-40CB-A014-021172B7A84C}" 00000001 15:53:41.304 T1 I00032 Command::ExecuteNonQuery EXIT Return: 1 Second time fails: ------------------ 00000002 15:53:42.507 T1 I00032 Command::ExecuteNonQuery ENTER CommandText: {call KeywordCleanup_MakeList(?)} CommandType: StoredProcedure CommandTimeout: 30 Par #1: , Input, Default, Default, System.String, "{1108005C-0F8B-4787-B227-AA7ABA81CCB9}" Error or Warning Received from Pervasive Server Number = 1 Message = Error retrieving error information Error Position = 0 After handling the exception, any further execution of pre-existing commands related to the same connection cause an NullReferenceException. I solved the problems by creating and disposing a new command object each time I need to run it, thus making it impossible to use the designer. |
#3
| |||
| |||
|
#4
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |