Closed
Description
Hi Community,
the change introduced by
#2308
leads to unexpected behavior in our environment. Postgres functions cannot be triggered as it was in eclipselink 4.0.4
The commit removes specific handling of postgres function calls which seem to be necessary for postgres versions < 17.
Local revert of:
- Revert "Fix calling stored procs on Postgres, and enable some tests (Fix calling stored procs on Postgres, and enable some tests #2308)"
This reverts commit 452ffdd.
fixes the problem.
Our environment:
- Glassfish 7.0.22
- EclipseLink 4.0.5
- Java/JDK version JavaSE 21
- Postgres 16.6
To Reproduce
If a postgres function is defined
create function some_fuction(param1 text, param2 integer, param3 integer) returns void
language plpgsql
as
$$
BEGIN
// Do something
end;
$$;
Both following versions of the function call throw SQL Exceptions:
//def and set param1, param2, param3, open transaction
StoredProcedureQuery storedProcedure = perServ.createStoredProcedureQuery("SOME_FUNCTION", void.class);
storedProcedure.registerStoredProcedureParameter("param1", String.class, ParameterMode.IN);
storedProcedure.registerStoredProcedureParameter("param2", Integer.class, ParameterMode.IN);
storedProcedure.registerStoredProcedureParameter("param3", Integer.class, ParameterMode.IN);
storedProcedure.setParameter("param1", param1);
storedProcedure.setParameter("param2", param2);
storedProcedure.setParameter("param3", param3);
storedProcedure.execute();
//def and set param1, param2, param3, open transaction
try (Connection c = /*create connection*/)){
c.setAutoCommit(false);
try (CallableStatement cs = c.prepareCall("{call SOME_FUNCTION(?,?,?)}")) {
cs.setString("param1", param1);
cs.setInt("param2", param2);
cs.setInt("param3", param3);
cs.execute();
}
c.commit();
}
//Exception handling
...
Kind Regards
Metadata
Metadata
Assignees
Labels
No labels