title: ORA-00001: unique constraint - recognize faulty record
body: <p>Let's say we have Oracle database with table called X. X** has deferred unique constraint on two of its columns. We have piece of code adding records to X.</p>
  <p>This operation is wrapped into <code>System.Transactions.TransactionScope</code>. We are using <strong>EF</strong> &quot;database first&quot; DbModel with <strong>Devart.Data.Oracle</strong> driver (version <strong>9.14.1382.0</strong>).</p>
  <p>From time to time we are attempting to add record that violates unique constraint so exception is thrown when committing transaction:</p>
  <blockquote>
  <p>ORA-00001: unique constraint (X_MD.AK_MD_DELAY_REASON) violated.</p>
  </blockquote>
  <p>I am wondering if there's a way to recognize which record exactly caused this error. So far I am aware of two options:</p>
  <ul>
  <li>overriding ValidateEntity method of DbModel and checking columns of new records whether they fulfil unique constraint in code. Checking this each time we add records would decrease performance</li>
  <li>DbUpdateException contains Entries collection with records that have caused given error. However (maybe due to usage of TransactionsScope) this type of exception is not present at any level of exception hierarchy thrown in our case (neither main exception or inner exception)</li>
  </ul>
  <p>But maybe there are other ways to find faulty records in such cases?</p>