I have five threads. They are doing OracleBulkCopy(1 million records each) into the same table (EXCEL_DATA) at same time. But at some point in time I am getting below error:
ORA-00604: error occurred at recursive SQL level 1 ORA-00054: resource busy and acquire with NOWAIT specified
I am using below code for OracleBulkCopy:
using (OracleConnection con = new OracleConnection(ConnectionString))
{
con.Open();
using (var bulkcopy = new OracleBulkCopy(con, options))
{
OracleTransaction tran =
con.BeginTransaction(IsolationLevel.ReadCommitted);
bulkcopy.DestinationTableName = DestinationTable;
foreach (var mapping in columnMappings)
bulkcopy.ColumnMappings.Add(mapping);
bulkcopy.BulkCopyTimeout = TimeOut.Value;
try
{
bulkcopy.WriteToServer(dataTable);
tran.Commit();
}
catch (Exception ex)
{
tran.Rollback();
}
}
}