PostgresQL stored procedure called from JDBC does not work <p>I have a postgresql database with some table and a stored procedure which write on this table. Everything goes fine, when I call this stored procedure from <code>psql</code>: I see my records inserted in my table. Although, when I call this stored procedure through JDBC, I get the log of stored procedure execution, the sequence is incremented, however my table is not updated.</p> <p>Here are the SQL I executed from a fresh postgresql installation (9.5.1):</p> <p>Table creation:</p> <pre><code>CREATE SEQUENCE atable_id_seq; CREATE TABLE IF NOT EXISTS "atable" ( "id" int NOT NULL DEFAULT NEXTVAL('atable_id_seq'), "name" varchar(250) DEFAULT NULL, PRIMARY KEY ("id") ); </code></pre> <p>The creation of stored procedure:</p> <pre><code>CREATE OR REPLACE FUNCTION awrite(IN name character varying, OUT result character varying) AS $$ BEGIN INSERT INTO atable(name) VALUES (name) RETURNING atable.id INTO awrite.result; RAISE INFO 'Create awrite: %', name; END $$ LANGUAGE plpgsql; </code></pre> <p>Calling awrite stored procedure from <code>psql</code> actually triggers the log in postgres and updates the table.</p> <p>Then I wrote a java program to call the same stored procedure:</p> <pre><code>HikariConfig hikariConfig = new HikariConfig(); hikariConfig.setDriverClassName("org.postgresql.Driver"); hikariConfig.setJdbcUrl("jdbc:postgresql://127.0.0.1:5432/toto?charSet=UNICODE"); hikariConfig.setUsername("toto"); hikariConfig.setAutoCommit(false); hikariConfig.setMinimumIdle(0); hikariConfig.setMaximumPoolSize(2); JdbcTemplate jdbcTemplate = new JdbcTemplate(new HikariDataSource(hikariConfig)); SimpleJdbcCall call = new SimpleJdbcCall(jdbcTemplate).withProcedureName("awrite"); HashMap&lt;String, Object&gt; params = new HashMap&lt;String, Object&gt;(); params.put("name", "Foo"); call.addDeclaredParameter(new SqlOutParameter("result", Types.VARCHAR)); Map&lt;String, Object&gt; result = call.execute(params); jdbcTemplate.execute("COMMIT;"); System.out.println("Result: "); for (String s : result.keySet()) { System.out.println(s + ": " + result.get(s)); } </code></pre> <p>I get an ID and execution went well. However my table does not contain the record.</p> <p>I don't get it, maybe someone could help me?</p>