Hibernate and JDBC Transaction integration

Source: Internet
Author: User

In general, you will use spring declarative transactions transactionattributes to Propagation_required

Hibernate uses Hibernatetransactionmanager, JDBC (IBATIS) to use Datasourcetransactionmanager

When they need to be consolidated into one transaction

The common practice is to configure unified DataSource, both Hibernate and JDBC (IBATIS) Use Hibernatetransactionmanager

There is a post in the jar that has elaborated this integration plan http://www.iteye.com/topic/11063?page=2

------------------------------------------------------

Hibernate and JDBC (IBATIS) both use Datasourcetransactionmanager.

The general view is that no! Think that Datasourcetransactionmanager does not deal with hibernate at all, the business of course can not be realized ...

But is that really the case?

The answer is no!, too. Http://forum.springframework.org/archive/index.php/t-9878.html

Juergen Hoeller:
Just If you proxies your JDBC DataSource with a transactionawaredatasourceproxy (available since Spring 1.1 RC1) and pass th At proxy to your Localsessionfactorybean, you could use Datasourcetransactionmanager in combination with Hibernate.

That is, the usetransactionawaredatasource of the configuration Sessionfactory is True

Hibernate and JDBC (IBATIS) both use Datasourcetransactionmanager to ensure that transactions

The principle is to ensure the uniqueness of the connection.

Hibernate and JDBC Transaction integration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.