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 6940503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:45:39+00:00 2026-05-27T12:45:39+00:00

I have weird behavior of inconsistent data returned from my DB when there are

  • 0

I have weird behavior of inconsistent data returned from my DB when there are 150+ users connected to our Web-app.

My EJBs connect to MySQL through mostly Netbeans 7.0 generated code, customized a bit for re-usability. What happens is that every so often, a user receives (in the browser) data that is not what it should be. I.e. User is viewing the details of product A, but part of the data (some one-to-many relationship data) belong to a different product. We don’t have this issue when less users are logged-in. It seems problems start to raise at about 150 users.

The EntityManager part of the code does only em.create(...), em.persist(...) or em.merge(...). There is no refresh() or flush(). I disabled the shared cache. I have no load balancing.

What/Where could I look more?

  • 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-05-27T12:45:40+00:00Added an answer on May 27, 2026 at 12:45 pm

    It depends on your situation.

    But for your information in case you want to use those methods:

    refresh() updates the entity with the data in the database table.

    flush() does the exactly opposite, saves the values in the entity to the database table.

    But since you are using EJBs, if you are using CMP then by default all the methods in an EJB run in a transaction (unless the transaction attributes are provided to not use them). And the transaction begins with the method call and ends when the method is done. At the end it is committed, which means you don’t need to call the flush(). But if you need to synchronize the database with the entity before the commit then you need to call the flush().

    Other than that it really depends on what your requirement is.

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

Sidebar

Related Questions

We have a weird intermittent problem with saving from Word 2007 to our SharePoint
It seems that i have this weird behavior in my Web Client My application
I have InApp purchasing setup in my app. I am having some weird behavior
I am experiencing weird behavior with template toolkit, say I have a data structure
I have a rails app and I keep getting a weird behavior with pjax
I have a Rails 3.1 app where I just got some weird behavior. I
I'm fairly new to SVN and I have a weird behavior issue. I'm working
I have some extremely weird behavior that seems to result in silent exceptions. How
Weird behavior when mixing loading of assemblies using Assembly.LoadFrom and Assembly.Load : I have
This is the day of weird behavior. We have a Win32 project made with

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.