Description:
CUBRIDCommand.GetGeneratedKeys() throws an exception saying AutoCommit must be false. Why this method requires the autocommit must be true?
Sample Code:
{noformat}
string sqlTablesCount = select count(*) from db_class;
int tablesCount, newTableCount;
using (CUBRIDConnection conn = new CUBRIDConnection())
{
conn.ConnectionString = DBHelper.connString;
conn.Open();
DBHelper.ExecuteSQL(drop table if exists tkeys, conn);
tablesCount = (int)DBHelper.GetSingleValue(sqlTablesCount, conn);
DBHelper.ExecuteSQL(create table tkeys(id int auto_increment, str string), conn);
newTableCount = (int)DBHelper.GetSingleValue(sqlTablesCount, conn);
//Verify table was created
Assert.IsTrue(newTableCount == tablesCount + 1);
CUBRIDCommand cmd = new CUBRIDCommand(insert into tkeys(str) values('xyz'), conn);
cmd.ExecuteNonQuery();
cmd.CommandText = insert into tkeys(str) values('abcd');
cmd.ExecuteNonQuery();
DbDataReader reader = cmd.GetGeneratedKeys();
}
{noformat}