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

  • SEARCH
  • Home
  • 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 8797503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:52:15+00:00 2026-06-13T23:52:15+00:00

I have a managedbean that has a list of entity objects of current page.

  • 0

I have a managedbean that has a list of entity objects of current page. after I create a new object and persist it to db using persist() in a transaction; in another transaction when I call merge(because the entity is in detached state due to previous transaction commit); entitymanager cannot find the object in persistence context and throw a select query to database. Am I missing something or is that normal behavior?

Update: The above problem exists when I use mysql database and autogenerated Id column. It does not exist when I use Oracle where I use sequence for Ids; but still; persistence context should know about the generated id; also is there any way to peek into persistence context to see what entities exits; I am using hibernate btw

  • 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-13T23:52:16+00:00Added an answer on June 13, 2026 at 11:52 pm

    It is normal behevior. A persistence context, by default, has the same lifetime of the transaction. And it’s completely normal: once the transaction is committed, other transactions might modify the entity, and Hibernate must reload the entity from the database to make sure it doesn’t return stale values.

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

Sidebar

Related Questions

I have an object (Ticket), which has a list of other objects (Message). Message
I have a ManagedBean say clsA, inside this clsA has a BOC object that
I have page in which I edit some entity. That page has two command
I have a <h:selectOneMenu> that has <f:selectItems> with CategoryHistory objects loaded in it. I
I have a JSF ManagedBean which has a property that should be set by
I have an Entity/JSF Managed Bean Ticket that represents a helpdesk ticket. It has
I have a page that is backed by a ViewScoped Managed Bean. The page
I have a Controller bean (SearchController) that has two managed bean as managed properties
Currently I have only one controller AppController ( SessionScope - ManagedBean ) that handles
I have a (JSF 2.0/ Primefaces 2.2RC-SNAPSHOT) app that has <p:layout> I use a

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.