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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:36:52+00:00 2026-05-24T04:36:52+00:00

I am working on a legacy jsp web application that uses JDBC and inline

  • 0

I am working on a legacy jsp web application that uses JDBC and inline SQL Statements.

We are having an issue with incorrect data in the database and I am wondering if it is possible for two statements to be executed in a different order than the order that they are specified in the code. i.e. if we have two update statements that are run like the following example.

String sql1 = "update table set x = y";
String sql2 = "update table set z = a";
Statement statement = conn.createStatement();
db_wrapper.runSQL(sql1,statement);
db_wrapper.runSQL(sql2,statement);

Is it possible that under heavy load the second sql statement will be run before the first one by the database.

The install we are mostly having the problem with runs on an oracle database.

Also the code currently does not use transactions.

  • 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-24T04:36:53+00:00Added an answer on May 24, 2026 at 4:36 am

    No, that thread will call Oracle driver in that order, there is no explicit reordering of method calls, nor reordering or queries in JDBC.

    However :

    1. Are you sure your code is not buffering calls to the database and eventually executing it in different order or sending it to different connections? If it sends queries to different connections, it could happen that one of those connections, executing the second statement, terminate before the first one, and the first one fails.
    2. Are you checking the return value of your calls? Or the exception? Could it be that the first query simply fails for whatever reason which is not checked by your code? Maybe catch’d, logged somewhere obscure (like system out) and never taken seriously?
    3. The driver may act in strange way. While I don’t know which version of Oracle you are working on, JDBC drivers are rather free to do what they want.
    4. Under heavy load, more than one thread will be executing the JSP, so unless the code is properly synchronized or the query properly scoped, a number of strange things could happen.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are working with a legacy database that uses SQL server uniqueidentifier columns for
I have been working on some legacy C++ code that uses variable length structures
I'm working on a legacy application that is using simple JSPs that are nested
Working on a legacy ASP.NET application we've found that ASP.NET session gets used for
I'm working with a legacy database that stores GUID values as a varchar(36) data
I have recently started working on a legacy application that has most of its
Working on a legacy application at the moment and we are replacing the data
I am working on a legacy ASP application. I am attempting to insert a
We are working with some legacy code that accesses a shared drive by the
I have been working on a legacy C++ application and am definitely outside of

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.