我按以下方式调用程序:
CallableStatement delete_procedure = connection.prepareCall("{ call schema.delete( ? ) }");
delete_procedure.setInt(1, id);
delete_procedure.execute();
delete_procedure.close();
connection.close();
当我运行命令delete_procedure.execute()
时,程序崩溃了。我没有遇到任何例外。是什么导致了这种行为?我使用以下功能,工作正常:
CREATE OR REPLACE FUNCTION schema.delete(integer)
RETURNS void AS
alter table schema.table disable trigger del_trg;
delete from schema.table where id = $1;
alter table schema.table enable trigger del_trg;