A different object with the same identifier value is already associated with the session

Source: Internet
Author: User

Today in the SSH2 project, there was this mistake, always feel that their code is not wrong, looking for a long time ....

Slag slag I in despair, suddenly fix!!!

Originally, I get the data from the database in the DAO layer to get a PO object, and then I have a method in the service layer to convert it to a Vo object

When I want to use him, I want to convert this Vo object into Po object, delete ...

The problem is out here ... Session is closed, from the Vo object again to the so-called Po object, can do the database operation again!!!

Simplify the tedious conversion, directly to the DAO directly manipulate PO objects can be

A different object with the same identifier value is already associated with the session

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.