title: JPA Hibernate calling stored procedure
body: <p>I have a stored procedure in Postgres. That procedure has 4 OUT parameters. Using JPA normally I can't get the results. What I'm trying to do is use a SELECT query with that procedure.</p>
  
  <p>For example If I try in pgAdmin the query:</p>
  
  <p>SELECT * FROM get_results (arg0, arg1 etc);</p>
  
  <p>I get one result row containing 4 columns with the results from the 4 OUT parameters.</p>
  
  <p>But When I try to use it in JPA it fails. I'm trying something like:</p>
  
  <pre><code>Query q = em.createNativeQuery("SELECT * FROM get_results (arg0, arg1 etc)");
  q.getSingleResult();
  </code></pre>
  
  <p>But it throws an <code>java.lang.IllegalStateException [com.arjuna.ats.internal.jta.transaction.arjunacore.nosuchtx] [com.arjuna.ats.internal.jta.transaction.arjunacore.nosuchtx] No such transaction!</code></p>
  
  <p>Any suggestions? </p>