I just started learning Hibernate, but based on the reading I have done in the manual, the below code appears to be using auto-commit as commit() is not being explicitly called. All of the examples I found here show use of commit(). Since I am just learning I wanted to get confirmation from the community that I was thinking the right way.
this.session = HibernateUtil.getSessionFactory().getCurrentSession();
Transaction tx = session.beginTransaction();
entityReturned = (MultipleKeyTable) session.get(MultipleKeyTable.class, entityId);
You can setup the autocommit mode at hibernate via
please read the configuration documentation
Based on your updated question, you are not using
autocommit since you didnt specify the
autocommit in your configuration. You are also making a
select query, so you wont see if something happens in your db. make some changes, save them and then check again.
You need to commit your transaction in order to save the changes, or define
autocommit = true at your properties.