Hibernate open-session-in-view Pattern

Source: Internet
Author: User

Using hibernate to continue writing code to deal with the association is very complicated. Considering using association ing.

The first use is the notorious lazyinitializationexception, so refer to hibernate's best practice to use the open-session-in-view method.

 

Http://www.jroller.com/cardsharp/entry/open_session_in_view_pattern

 

This article is true: it seems inappropriate to expose the back-end processing mechanism in the presentation layer, but it is so transparent and easy to use.

 

As for performance, there are many discussions online. Theoretically, there is an impact. However, to what extent? What kind of pressure threshold will be reached?

 

For internal enterprise applications, no more than 10,000 users should be the bottleneck.

 

After all, the current application software development is more challenging in terms of development speed and code maintainability.

 

PS:

 

Configuring:

Org. springframework. Orm. hibernate. Support. opensessioninviewfilter

~~~~~~~

To be modified

Org. springframework. Orm. hibernate3.support. opensessioninviewfilter

 

When there are several configurations, the class not found will be caused by the missing 3.

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.