Any transaction is committed on Session.close(). hibernate.connection.autocommit property is ignored.
I found out that auto- commit is turned on in org/hibernate/engine/jdbc/connections/internal/PooledConnections.java line 66
Here is code to reproduce:
{code:java} Session s = Database.getSession(); Transaction t = s.beginTransaction();
User u = new User();
s.save(u);
//t.commit();
s.close(); {code}
PostgreSQL log:
{code:java} < 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 {code}
|
|