Hi, I’m the developer who originally investigated the issue and came up with this bug.
What we were trying to accomplish is a bulk insert of a number of rows directly in the table.
We created an OracleDbCommand that is simply an insert command into a table
OracleCommand oracleCommand = new OracleCommand();
oracleCommand.CommandText = string.Format("insert into {1} ({2}) values ({3})", tableName, columns, parameters)
But the parameters are now an array of values, each index correspond to the values of a single row.
OracleParameter parameter = new OracleParameter(parameterName, GetDbType(column.DataType));
parameter.Value = dataTable.AsEnumerable().Select(dr => dr.Field<DateTime?>(column)).ToArray();
oracleCommand.Parameters.Add(parameter);
Basically, we are passing around a DataTable and for each parameter, we take all values of the corresponding DataTable column and add it as a parameter value.
This is how we end up with a DbCommand where the parameter values are basically arrays of values, corresponding to the DbType.
Otis is on the right track. So what happens is that the execution of the ActionQuery fails (in my local test I got an ORA exception because of not enough disk space?).
That one is catched in which you are trying to create an ORMQueryExecutionException.
catch (Exception ex)
{
throw new ORMQueryExecutionException(string.Format("An exception was caught during the execution of an action query: {0}. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.", (object)ex.Message), base.ToString(), this.Parameters, ex, this.GetExceptionInfo(ex as DbException));
}
In here, you call base.ToString(), which will stringify the DbCommand (I guess for debug/info purposes).
The problem is linked to the DbType.DateTime case, yes only DateTimes are an issue here.
case DbType.DateTime:
str = string.Format("{0}", (object) ((DateTime) dbDataParameter.Value).ToString("O"));
Because our dbDataParameter.Value contains an array of DateTime objects, the cast to a single DateTime is failing