Look at the following code that accesses a database with transaction boundaries without using commit:
Session session = sessionFactory.openSession();
session.beginTransaction();
session.get(Item.class, 123l);
session.close();
By default in a Java SE environment with JDBC configuration, this happens if you execute this snippet:
: " !" JDBC , close() . , , . , Oracle JDBC close() ! JDBC , JDBC .
, SELECT, , :
Session session = getSessionFactory().openSession();
session.beginTransaction();
Long generatedId = session.save(item);
session.close();
INSERT, , . Oracle ; . ( : INSERT , . , INSERT. , . .)