From: Mark R. <ma...@la...> - 2013-12-06 19:38:56
|
On 27-11-2013 09:28, Kjell Rilbe wrote: >> The problem is that you did not close the command, which means it is >> still prepared, which marks the table as used. Now when you close the >> connection, the command will be closed as well. > > I looked for an Unprepare method, and didn't find it. Thought "oh well". > Didn't think to look for Close. I'll give that a try. There is no concept of 'unprepare' in Firebird. Either a statement handle is prepared with a different statement, or the statement handle is closed. Both will effectively unprepare the old statement, but it is not entirely the same concept ;) >> So the solution is to wrap the command (and everything that uses the >> command) in a using block as well. > > Or call cmd.Close explicitly? Sure, but personally I prefer using, because you don't have to add boiler plate to ensure the object gets closed and disposed when exceptions occur. -- Mark Rotteveel |