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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:15:56+00:00 2026-05-23T17:15:56+00:00

When you have eg. 3 queries in a row that you submit to a

  • 0

When you have eg. 3 queries in a row that you submit to a SQL database as a single string, separated by semicolons, and another user does that exact same thing at the same time, will our queries be seen as a “group” or “queue” of queries which will always execute in the same, logical order per user, or can the queue for these queries get “mixed up”, ending up with both our queries being fired one by one?

So basically I want to know which one of the following situations both MySQL and SQL Servers will behave like when this occurs:

  • execution path situation 1:

  • user 1 query 1, user 1 query 2, user 1 query 3, user 2 query 1, user 2 query 2, user 2 query 3

  • execution path situation 2:

  • user 1 query 1, user 2 query 1, user 1 query 2, user 2 query 2, user 1 query 3, user 2 query 3
  • 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-23T17:15:56+00:00Added an answer on May 23, 2026 at 5:15 pm

    This depends on whether your database sees this as a number of separate queries or as a single transaction. If it sees it as a transaction, the order won’t matter. If you want to ensure it sees it as a single transaction, there are ways to signal to the database that it should create a transaction for your queries. The database (should) ensure four basic properties (ACID):

    • Atomic – The entire transaction succeeds or fails.
    • Consist – The database will always be left in a consistent state, regardless of whether a transaction succeeds or fails.
    • Isolated – Multiple transactions being processed at the same time cannot interfere with each other.
    • Durable – The database must be able to recover committed data after software and hardware failures.

    Isolation is the one relevant to your case. Your queries should not be able to sabotage another person’s, so you should not need to worry about other users submitting queries at the same time.

    Also, I doubt that your database is running off a single processor. It’s likely that the linear paths you described wouldn’t happen simply because the database can handle multiple queries simultaneously.

    For safety’s sake, I’d start your query with a BEGIN TRANSACTION and end it with COMMIT TRANSACTION (or whatever syntax your database requires). If the database does see it as a number of separate queries, you could have problems if they do any writing to the database. Best to use a transaction.

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

Sidebar

Related Questions

I have some queries made by GWT (2.4) RequestBuilder that might take a long
I have a small sql question for you. I have two queries: SELECT tbl_CostPrevisions.Month,
In my MVC3 application, I have a queries class specific to each controller that
I have a row that contains 3 fields: day earnings person 1 3 1
I have decided to create a new table in my database that will be
I am just begining php and mysql. I have two queries from my database.
I used to think that Oracle does not index a row when one of
i have these two queries, that i want to join together, but am not
I have 2 sql queries in my code where the second one is wrapped
I have two queries that are functionally identical. One of them performs very well,

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.