Any transaction is committed on Session.close(). hibernate.connection.autocommit property is ignored. I find out that commit is turned on in org/hibernate/engine/jdbc/connections/internal/PooledConnections.java line 66 Here is code to reproduce:
Session s = Database.getSession();
Transaction t = s.beginTransaction();
User u = new User();
s.save(u);
s.close();
PostgreSQL log:
< 2016-01-08 19:13:53.887 EET >LOG: execute <unnamed>: SET extra_float_digits = 3
< 2016-01-08 19:13:53.930 EET >LOG: execute <unnamed>: SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE
< 2016-01-08 19:13:53.977 EET >LOG: execute <unnamed>: BEGIN
< 2016-01-08 19:13:53.977 EET >LOG: execute <unnamed>: select nextval ('hibernate_sequence')
< 2016-01-08 19:13:54.027 EET >LOG: execute S_1: COMMIT
|