How to call a stored procedure from Java and JPA

JPA 2.1 now support Stored Procedure, read the Java doc here. Example: StoredProcedureQuery storedProcedure = em.createStoredProcedureQuery(“sales_tax”); // set parameters storedProcedure.registerStoredProcedureParameter(“subtotal”, Double.class, ParameterMode.IN); storedProcedure.registerStoredProcedureParameter(“tax”, Double.class, ParameterMode.OUT); storedProcedure.setParameter(“subtotal”, 1f); // execute SP storedProcedure.execute(); // get result Double tax = (Double)storedProcedure.getOutputParameterValue(“tax”); See detailed example here.

Using HeapDumpOnOutOfMemoryError parameter for heap dump for JBoss

Here’s what Oracle’s documentation has to say: By default the heap dump is created in a file called java_pid.hprof in the working directory of the VM, as in the example above. You can specify an alternative file name or directory with the -XX:HeapDumpPath= option. For example -XX:HeapDumpPath=/disk2/dumps will cause the heap dump to be generated … Read more