From: Maarten K. <mk...@xs...> - 2003-05-03 11:23:56
|
Hi, I have a problem with ExecuteReader. I have the following code: ------- public override NodeData getNodeData(int id) { NodeData data = new NodeData(0); FNodeGetNodeDataCommand.Parameters["@ID"].Value = id; FNodeGetNodeDataCommand.Transaction = FTransaction; try { FbDataReader reader = FNodeGetNodeDataCommand.ExecuteReader(CommandBehavior.SingleRow); try { if (!reader.Read()) { throw new Exception("Node not found (" + id + ")"); } assignNodeData(reader, ref data); } finally { reader.Close(); } } catch { // ..... throw; } return data; } --------- If I begin a transaction outside this method and then call this method multiple times without committing the transaction inbetween, the second time I call this method I get a FbException on the call to ExecuteReader with the message: "Dynamic SQL Error SQL Error Code = -502 Attempt to reopen an open cursor". If I start and commit a transaction for every call I don't get the exception. Does anyone see what I am doing wrong here? Thanks, Maarten |