title: spring & plsql stored procedure - exception handling & transactions
body: <p>I need to call oracle stored procedure from spring (via Hibernate).</p>
  
  <p>I'm not familiar with PL/SQL so I would like to know how to proceed with that. </p>
  
  <p>1) Can I use spring/hibernate (for instance annotations) to begin/close transaction. I assume that it's not an issue and I don't have to begin/close inside stored procedure.</p>
  
  <p>2) In the mentioned procedure I'm opening and closing the cursor but in case of exception I would like to close it and rethrow an exception to Java part, so here's what I've done:</p>
  
  <pre><code>EXCEPTION
    WHEN OTHERS THEN
     CLOSE my_cursor; 
     RAISE e_cannot_do_sth;
  </code></pre>
  
  <p>I want to raise an exception so I could let user know that something went wrong...</p>
  
  <p>What is the best way to do it?</p>