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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:49:39+00:00 2026-06-11T11:49:39+00:00

Let’s suppose API server access the SQL server from request, the connection for the

  • 0

Let’s suppose API server access the SQL server from request, the connection for the MySQL server is such.

    @mysql_connect(HOSTNAME,DATABASE_USER, DATABASE_PASSWORD) or die('Could not connect to : ' . mysql_error());

    @mysql_select_db(DATABASE_NAME) or die( "<-----------------------Unable to select database------------------>");     

is there a way to detect whether the connection is already opened? If it’s opened then make a sql transaction.

Let’s say while accessing table A, another API request call from outside come in and wanting to acess table B.

IS it possible to initiate an access to table B while table A operation still in progress.

In other word, don’t wait access Table A to finish. As soon as access Table B come in then start it.

  • 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-11T11:49:40+00:00Added an answer on June 11, 2026 at 11:49 am

    @jasonwhite I believe that concurrency is handled at the DBMS level, which, depending on the operation in question, already supports the possibility of two operations running at the same time. If for example, operation one were a SELECT operation, and operation two were an INSERT operation both could be executed at the same time. In fact, regardless of the operation types this would be possible, except if the tables were related via a foreign key constraint. This is because MySQL implements table-locking during operations, in which it locks a table while an operation is being executed on it, and then releases the table once that operation is completed.

    Regarding checking if a connection already exists, you would need to implement a singleton method that would check if the connection already exists. If it does not, create it and return it; if it does, return the existing connection. This would look something like this:

    function getConnection() {
        global $conn; //I do not recommend using globals, rather create a class for this
        if(is_null($conn)) {
             $conn = mysql_connect(HOSTNAME,DATABASE_USER, DATABASE_PASSWORD) or die('Could not connect to : ' . mysql_error());    
             mysql_select_db(DATABASE_NAME) or die( "<-----------------------Unable to select database------------------>");
        }
        return $conn;        
    }
    

    AFAIK, you have no further control over whether one operation will wait for another during execution. My $0.02.

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

Sidebar

Related Questions

Let's say I have such MYSQL table for logins: id---name---location---login_date ---------------------------------- 1----mike----usa-----21.08.2012 2----tony----uk------22.08.2012 3----tony----uk------23.08.2012
Let's suppose I have an XML file like this: <?xml version=1.0 encoding=ISO-8859-1?> <MIDIFile> <Event>
Let's take a common example how a haskell function can be called from a
Let's suppose I have a Discussion model, and that a discussion can be tagged.
Let's suppose I have this piece of code. foreach(string value in myList) { string
Let's say I'm building a data access layer for an application. Typically I have
Let me try to explain what I need. I have a server that is
Let's say I have a drive such as C:\ , and I want to
Let's suppose there are many divs inside a div: <div id=#container> div div div
Let's say I have an Instant Messenger server using SignalR. I want to broadcast

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.