title: Error selecting column recently inserted with ALTER TABLE in ODP.NET
body: <p>1- Connect to a Oracle XE using Oracle.DataAccess</p>
  
  <p>2- Execute a command to add a column to a table: alter table TABLE add COLUMN b int;</p>
  
  <p>3- Execute a command to select this column</p>
  
  <p>4- Read with a DataReader. Application raises IndexOutOfRangeException: Unable to find specified column in result set</p>
  
  <p>5- Restart the application and the query runs correctly</p>
  
  <p>Why DataReader can't access the column I have created just now?</p>
  
  <p>Here is a large but simple code to test:</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      using (OracleConnection con = new OracleConnection(Settings.Default.CS))
      {
          con.Open();
          try
          {
              using (OracleCommand com = new OracleCommand())
              {
                  com.Connection = con;
  
                  // Create a test table
                  com.CommandText = "CREATE TABLE Test (a int)";
                  com.ExecuteNonQuery();
  
                  // Add one column
                  com.CommandText = "ALTER TABLE Test ADD b int";
                  com.ExecuteNonQuery();
  
                  com.CommandText = "SELECT * FROM Test";
                  using (DbDataReader dr = com.ExecuteReader())
                  {
                      MessageBox.Show(dr.FieldCount.ToString());
                      // Here is showing "2", thats ok
                  }
              }
          }
          finally
          {
              con.Close();
          }
      }
  }
  
  private void button2_Click(object sender, EventArgs e)
  {
      using (OracleConnection con = new OracleConnection(Settings.Default.CS))
      {
          con.Open();
          try
          {
              using (OracleCommand com = new OracleCommand())
              {
                  OracleTransaction trans = con.BeginTransaction();
                  try
                  {
                      // Add a column to table already created
                      com.Connection = con;
                      com.CommandText = "ALTER TABLE Test ADD c int";
                      com.ExecuteNonQuery();
  
                      // Insert a value, ok
                      com.CommandText = "INSERT INTO TEST (a, b, c) VALUES (1, 2, 3)";
                      com.ExecuteNonQuery();
  
                      trans.Commit();
                  }
                  catch
                  {
                      trans.Rollback();
                      throw;
                  }
  
                  // Selecting only "c" column
                  com.CommandText = "SELECT c FROM Test";
                  using (DbDataReader dr = com.ExecuteReader())
                  {
                      if (dr.Read())
                          MessageBox.Show(Convert.ToInt32(dr["c"]).ToString());
                          // Showing correct value, ok
                  }
  
                  // Uncomment these lines to solve problem
                  //con.Close();
                  //OracleConnection.ClearAllPools();
                  //con.Open();
  
                  // Selecting all fields * from table
                  com.CommandText = "SELECT * FROM Test";
                  using (DbDataReader dr = com.ExecuteReader())
                  {
                      MessageBox.Show(dr.GetSchemaTable().Rows.Count.ToString() + " / " + dr.FieldCount.ToString());
                      // HERE IS THE PROBLEM: message are showing 2/2, but table haves 3 fields
  
                      if (dr.Read())
                          MessageBox.Show(Convert.ToInt32(dr["c"]).ToString());
                      // Here throws IndexOutOfRangeException: Unable to find specified column in result set
                  }
              }
          }
          finally
          {
              con.Close();
          }
      }
  }
  </code></pre>