title: Simulate ORA-3113: end-of-file on communication channel
body: <p>I have a C# Windows IIS server (Windows Server 2003) application connecting to an Oracle database hosted on Linux (10gR2 on Red Hat 5.3). Intermittetly, Oracle throws an ORA-3113: end-of-file on communication channel error. This screws up the OracleConnection object in C#. Then, any new OracleCommands that try to use the OracleConnection all fail saying the connection has been closed.</p>
  
  <p>I have reviewed the Oracle trace files generated by this error and have isolated the problem to faulty network hardware and am working to fix it.</p>
  
  <p>However, I need to make my C# code more robust and have it respond appropriately to this error by closing and not using that connection object anymore. It is easy to catch the exception in C#, but I cannot reproduce the network issue in the Development environment to prove my code works &amp; cleans up after itself.</p>
  
  <pre><code>try
  {
    oracleCommand.ExecuteNonQuery();
  }
  catch(OracleException exception)
  {
    if(exception.Code == 3113)
      CloseAndCleanup();
  }
  </code></pre>
  
  <p>I have tried coding a PL/SQL trigger on a table that throws an ORA-3113 when I try to INSERT into the table. </p>
  
  <pre><code>CREATE OR REPLACE TRIGGER SCHEMA.TABLE
  BEFORE DELETE OR INSERT OR UPDATE
  ON SCHEMA.TABLE
  FOR EACH ROW
  DECLARE
    CONNECTION_LOST_CONTACT   EXCEPTION;
    PRAGMA EXCEPTION_INIT (CONNECTION_LOST_CONTACT, -3113);
  BEGIN
    RAISE CONNECTION_LOST_CONTACT;
  END;
  </code></pre>
  
  <p>This throws the right error, but doesn't corrupt the OracleConnection object in C#. I can still send commands to the OracleConnection and it works.</p>
  
  <p><strong>How can I accurately simulate the ORA-3113 error?</strong></p>