I have a stored procedure in an Oracle DB, which I wish to call from my EJB AS (websphere) using the following JPA code. The procedure includes some "COMMIT" in its body. The point is that when I remove the COMMIT of the procedure, JPA is able to invoque the procedure correctly. If I leave the COMMIT then I get an exception telling me that the call cannot be executed.
The java code is placed in a session bean with the transaction set up as REQUIRED by default.
public void updateProc() {
Query query = entityManager.createNativeQuery("call UPDATE_MYPROC()");
query.executeUpdate();
}
I think the problem has to do with the transaction, but not sure. Can anybody help? Thanks!