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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:06:11+00:00 2026-05-13T07:06:11+00:00

My current set up is a single dedicated server with Java, hibernate app running

  • 0

My current set up is a single dedicated server with Java, hibernate app running on tomcat, apache http server, MYSQL.

I need to get a second server to share the load, but using the same database from the first server.

The backend processing(excluding db transaction) is time consuming, hence the second server for backend processing).

Will there be any unwanted consequences of this setup? Is this the optimal setup?

My apps do update/delete and has transaction control as follows:

beginTransaction();
            getSession().save(obj);
            //sessionFactory.openSession().save(obj);
            commitTransaction()
  • 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-13T07:06:12+00:00Added an answer on May 13, 2026 at 7:06 am

    As long as only one of the apps does database updates on a shared table you should be fine. What you definitely don’t want to happen is:

    app1: delete/update table1.record24
    app2: delete/update table1.record24
    

    because when Hibernate writes the records one of the processes will notice the data has changed and throw an error. And as a classic Heisenbug it’s really difficult to reproduce.

    When, on the other hand, the responsibilities are clearly separated (the apps share data for reading, but do not delete/update the same tables) it should be ok. Document that behavior though as a future upgrade may not take that into account.

    EDIT 1:Answering comments

    You overcome concurrency issues by design. For any given table:

    • Both apps may insert
    • Both apps may select
    • one of the apps may also update / delete in that table

    Your frontend will probably insert into tables, and the backend can read those tables,
    update rows where necessary, create new result rows, and delete rows as cleanup.

    Alternatively, when the apps communicate, the frontend can transfer ownership of the records for a given task to the business backend, which gives the ownership back when finished. Make sure the hibernate cache is flushed (transaction is executed) and no hibernate objects of that task are in use before transferring ownership.

    The trick of the game is to ensure that Hibernate will not attempt write records which are changed by the other app, as that will result in a StaleStateException.

    And example of how I solved a similar problem:

    • app 1 receives data, and writes it in table1
    • app 2 reads table1, processes it, and writes/updates table2
    • app 2 deletes the processed records in table1

    Note that app 1 only writes to the shared table. It also reads, writes and updates from other tables, but those tables are not accessed by app 2, so that’s no problem.

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

Sidebar

Ask A Question

Stats

  • Questions 273k
  • Answers 273k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Just an addition to skaffman's post: What you see (SomeJaxbAnnotatedClass$JaxbAccessor...)… May 13, 2026 at 2:06 pm
  • Editorial Team
    Editorial Team added an answer You might be interested in Levenshtein distance. The Levenshtein distance… May 13, 2026 at 2:06 pm
  • Editorial Team
    Editorial Team added an answer Not quite sure what you mean? Both statements you have… May 13, 2026 at 2:06 pm

Related Questions

I'm trying my hand at behavior driven development and I'm finding myself second guessing
As the title says, I'm fleshing out a design for a 2D platformer engine.
I am starting a web application project that will have an Adobe Flex front-end
I'm new to Mercurial and what I'm starting to realize is that my basic
I run all my Django sites as SCGI daemons. I won't get into the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.