I'm using PostgreSQL 9.3 and I have some stored procedures created which contains several statements. I'm calling this stored procedures in a Java application with the help of a prepared statement.
Now I've read that each statement inside the stored procedure is executed as a transaction, i.e. one commit after each statement. But what I want is to have the whole stored procedure executed as one transaction, i.e. only one commit.
How can I do this? Perhaps deactivating autocommit on the JDBC level?
Well, basically stored procedures are atomic in nature and executed as one transaction.
Then try invoking
f()
frompsql
.