C# 在TransactionScope内批量插入时发生ORA-00604错误
我正在尝试在TransactionScope中使用ADO.NET将100k+项批量插入到Oracle数据库中。像这样:C# 在TransactionScope内批量插入时发生ORA-00604错误,c#,oracle,ado.net,transactionscope,batch-insert,C#,Oracle,Ado.net,Transactionscope,Batch Insert,我正在尝试在TransactionScope中使用ADO.NET将100k+项批量插入到Oracle数据库中。像这样: using (TransactionScope transaction = new TransactionScope()) { while(/* Pagination logic - send insertion command on every 250 items */) { using (OracleCommand command = new
using (TransactionScope transaction = new TransactionScope())
{
while(/* Pagination logic - send insertion command on every 250 items */)
{
using (OracleCommand command = new OracleCommand(query, connection))
{
command.ArrayBindCount = 250;
//Add parameters
command.Parameters.Add(":BLAH", OracleDbType.Long);
command.Parameters[0].Value = LUC.ToArray();
command.ExecuteNonQuery(); //Error occurs here after N-times inside while
}
}
transaction.Complete();
}
对于低于此(10k-30k)的项目,交易已成功完成。
但是对于更高的项目(如100k),我得到了ORA-00604:在递归SQL级别%s发生错误
如果我完全删除TransactionScope,我不会得到任何项目大小的错误,它只是工作
如何使TransactionScope处理大量项目?结果是,这是一个事务超时问题 增加超时后,我已成功插入列表:
using (TransactionScope transaction =
new TransactionScope(TransactionScopeOption.Required,
new TimeSpan(0, 30, 0))) //30 minute timeout limit