title: How to run oracle stored procedures asynchronously and independently from client application?
body: <p>I have implemented a stored procedure that generates a csv report based on the data in a <code>transaction_table</code>, and stores the generated report in <code>report_table</code> for future references.<br>
  I execute and pass arguments to this procedure using JPA in a java program and it works perfectly fine.<br><br>Problems are:</p>
  
  <ul>
  <li>since we have huge amount of transaction data in <code>transaction_table</code>, it takes some time for report to be generated. And during this time the the pop-up thread responsible for generating the report is blocked.</li>
  <li>If database connection for running the procedure gets broken in the middle of execution, not even we don't get the report , but also the database thread responsible for handling the request does not get completed and remains in the memory in some unknown state.So we need an active connection with database during execution time.</li>
  </ul>
  
  <p>My questions are:<br></p>
  
  <ol>
  <li>Is there any way to call procedure and return immediately, without having a thread in the application blocked for entire execution time of stored procedure. </li>
  <li>Since there is a chance of losing the database connection, is there any way that database can run the procedure <strong>independently</strong> from the application that is calling it, so that it gets completed even in the absence active connection.</li>
  </ol>
  
  <p><strong>Note that</strong> I need to pass the report parameters from application to the procedure.</p>
  
  <p>I have <em>Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production</em>, running on the server.</p>