title: Firebird dot net provider doesn't fully execute query?
body: <p>I'm running a number of SQL command using the dot net provider for Firebird in c#.  Specifically I'm changing the database schema, and doing data updates and the like.   </p>
  
  <p>As part of my processing I create a new table, run a query to copy data from an old table, and then drop the old table.  </p>
  
  <p>When I do this firebird generates and error:</p>
  
  <blockquote>
    <p><em>unsuccessful metadata update object  is in use</em></p>
  </blockquote>
  
  <p>I've done some looking and it <em>seems</em> like the query to copy the data hasn't been "cleared" our or something yet. What I mean is when I check the monitoring tables in Firebird with my c# execution paused I see the query in the <code>MON$STATEMENTS</code> table, as inactive. This is after I've run a commit statement.</p>
  
  <p>My questions:</p>
  
  <p>Is there a way to pause, or wait, or force the query to fully complete before I try to run the next command?   </p>
  
  <p>When I run the same sequence of queries in ISQL it works perfectly. Is there something different ISQL does that I can force the dot net Firebird provider to do so it doesn't keep this query open or something?</p>
  
  <p>So for reference the code looks something like this (obviously this is a very simplified):</p>
  
  <pre><code>    // create the table
      string commandString  = "CREATE TABLE ...";
  
      // run the command in a transaction and commit it
      mtransaction = Connection.BeginTransaction( IsolationLevel.Serializable );
      FbCommand command = new FbCommand(commandString, Connection, mtransaction);
      command.ExecuteNonQuery();
      transaction.Commit();
      transaction.Dispose();
      transaction = null;
  
      // copy the data to the new table from the old
      commandString = "INSERT INTO ...";
  
      mtransaction = Connection.BeginTransaction(IsolationLevel.Serializable);
      FbCommand command = new FbCommand(commandString, Connection, mtransaction);
      command.ExecuteNonQuery();
      transaction.Commit();
      transaction.Dispose();
      transaction = null;
  
      // drop the old table
      commandString = "DROP TABLE ...";
  
      mtransaction = Connection.BeginTransaction(IsolationLevel.Serializable);
      FbCommand command = new FbCommand(commandString, Connection, mtransaction);
      command.ExecuteNonQuery();
  
      // this command fails with the exception
      // if I pause execution in c# before running this command, and 
      // use isql to look at the db I see the new table, and the data fully populated
      // and I also see the inactive insert command in MON$STATEMENTS
      transaction.Commit();
      transaction.Dispose();
      transaction = null;
  </code></pre>