hibernate 4.3 resolves data issues that do not get the latest changes in the database using get data

Source: Internet
Author: User

hibernate 4.3 Resolves a data problem that does not get the latest changes in the database by using get data because of a caching problem

problem processes and phenomena :

Query a data list = "Manually update data in database =" Refresh page, data display or old data before update

Find a solution online :

1, using session.clear (); empty the cache before querying----tested, this method is invalid in version 4.3, other versions are not tested;

Reference connection: https://www.linuxidc.com/Linux/2014-09/106458.htm

2, do not use hibernate default connection pool, use C3P0 connection pool, because need to replace the driver, replace the package, did not test this method;

Reference connection:

52950432

Https://www.2cto.com/database/201411/351800.html

3, in the query, also add transaction use---- tested this method is valid , guess that the transaction commit triggered a cached update

Reference connection:

http://www.iteye.com/problems/37351

https://bbs.csdn.net/topics/392168198

hibernate 4.3 resolves data issues that do not get the latest changes in the database using get data

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.