HibernateDaoSupport update delete does not execute

I built an SSH framework myself, and the HibernateDaoSupport logic layer inherited from the dao layer did not take effect when calling the update and delete methods of the dao layer, so I configured hibernateProperties and typed out the sql statement to see,
<property name="hibernateProperties"><! -- hibernate tool configuration -->
<props>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.connection.autocommit">true</prop>
</props>
</ property>

It turns out that neither update nor delete methods generate sql statements. Most netizens said that the transaction was not submitted. As a result, I manually added transaction submission,
Session session = getHibernateTemplate().getSessionFactory().getCurrentSession();
Transaction transaction = session.beginTransaction();
session.update(object);
transaction.commit();

The result is successful, it seems that it is really a transaction commit problem, learn it and record it.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326823434&siteId=291194637