title: JPA & PostgreSQL: How do I call a stored procedure with void return type?
body: <p>I'm trying to call a PL/pgSQL function that executes an update (language sql, returns void). I'm getting this exception:</p>
  
  <p><code>Internal Exception: org.postgresql.util.PSQLException: A result was returned when none was expected.</code></p>
  
  <p>persistence.xml:</p>
  
  <pre><code>&lt;named-native-query name="Clinic.deactivateByNotFoundInIncomingClinic"&gt;
      &lt;query&gt;
          &lt;![CDATA[
              select apply_incoming_clinic_deletions(?)
          ]]&gt;
      &lt;/query&gt;
  &lt;/named-native-query&gt;
  </code></pre>
  
  <p>DAO:</p>
  
  <pre><code>public void deactivateByNotFoundInIncomingClinic(long clinicSystemId)
  {
      em.createNamedQuery("Clinic.deactivateByNotFoundInIncomingClinic")
              .setParameter(1, clinicSystemId)
              .executeUpdate();
  }
  </code></pre>
  
  <p>Help!</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Using EclipeseLink on GlassFish 3.1.1 talking to PostgreSQL 9.0 database via PostgreSQL 9.0-801 JDBC 4 drivers.</p>