Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7848221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:07:30+00:00 2026-06-02T18:07:30+00:00

Taking following code: MyEntity e = dao.getEntity(1); e.setProp1(someVal); e.setProp2(otherVal); MyEntity eOld = dao.getEntity(1); If

  • 0

Taking following code:

MyEntity e = dao.getEntity(1);
e.setProp1(someVal);
e.setProp2(otherVal);

MyEntity eOld = dao.getEntity(1);

If I do it like this then e will get updated (because Hibernate detected it is dirty) and eOld will have the same property values (prop1, prop2) a e. Is there a way to get the persisted state of this dirty entity (as it is in the database)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T18:07:32+00:00Added an answer on June 2, 2026 at 6:07 pm

    Actually I may already have found the solution myself…

    I had already tried evicting eOld but that doesn’t make since, I need to evict e before retrieving eOld and after the compare (for auditing) reattach (merge) e to the session again.
    It seems to work in any case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Taking the jQuery framework for example, if you run code like this: $(document).ready(function init()
I have something like the following code: <div style=border:2px black solid;overflow:hidden;> <span style=float:right;> <img
I'm using the following code to rotate an image by an angle taking the
I am using following code: <select class=element select medium id=inDistrict name=inDistrict onchange=setCookie('lastvalue',this.value,1);> It is
Please help with this error .... In the following code the get info function
I have the following code that is taking a while to process: self.itemsArray =
I would like to do the following (just an example, the real code has
Taking the following code, Resharper tells me that voicesSoFar and voicesNeededMaximum cause access to
The following code using ContentInfo(System.Security.Cryptography.Pkcs.ContentInfo) is really taking a long time to execute. Is
In the following code sample I have an Async Calculator class. This is injected

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.