"Conflict" problem happened at the old projects have transformed the course of congestive heart model. We give Bean the original set of methods add the business logic (such as the context of state changes, event-triggered, etc.). Implementation of the procedures followed by the problem, the symptoms are varied but usually can not reproduce the problem.

Through the code a good walk, and finally found (aware) Hibernate load for Bean, the default value of the property transfer is the use of bean's set method, this time triggered by a deal with the extra business logic. In other words, this time of congestive heart model and Hibernate to load the Bean "conflict" had.

Solve the "conflict" approach is very simple, Bean will be configured to direct property access (acess = feild).

This Bug is sometimes deeper than hidden. Since most of the set method is not business logic and Hibernate's save behavior session.close happened at a time when, if a bean is loaded at a time when, through the set methods to change another stealth Bean state, this time session. close, would put such an amendment "quiet" to preserve, without being a programmer found. Since code from a business on, the program just to read a bean, does not make any changes to actions, My god ~ ~ ~ ah lesson of blood and tears!

Want to see this classmate of Posts, everybody told everybody!