Spring transaction:
For traditional transactional processing based on a particular transactional resource, such as JDBC-based database access, spring does not have any effect on it, so we can successfully write and run such code. At the same time, spring also provides some auxiliary classes that we can choose to use, which simplifies the traditional database operation process, saves the workload to some extent, and improves the coding efficiency.
Spring shows great value for parameterized transaction management of dependent containers. Spring itself is a container, but spring is much lighter and smaller relative to the EJB container. We can implement container-based transaction management (essentially,Spring's transaction management is based on dynamic AOP) through spring without paying any other price.
Hibernate transaction:
Hibernate is a lightweight object encapsulation of JDBC, and hibernate itself does not have the transaction processing function, Hibernate's transaction is actually the transaction package of the JDBC or the jtatransaction package. The specific analysis is as follows:
Hibernate transaction can be configured with jdbctransaction or Jtatransaction depending on your configuration in hibernate.properties
The difference between hibernate transactions and spring transactions (GO)