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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:32:42+00:00 2026-06-01T07:32:42+00:00

For a game, I am trying to implement a scores table. According to game

  • 0

For a game, I am trying to implement a scores table. According to game logic the scores usually change when one user completes one round which occurs every few minutes; but there is no guarantee two users will finish same time.

In order to not to recalculate scores every time that a user checks scores, I plan to hold score data in a persistent table which will be updated every time a round is completed.

I plan to implement this by

TRUNCATE TABLE scores; INSERT INTO SCORES SELECT ....

but my concern is what happens when two users finish at the same time. I pass the whole query in one connection (from ASP.NET, if that matters), but are two queries together considered as atomic? Or do you suggest that I must implement a manual transaction logic?

If you suggest transaction, putting is it enough to enclose the query with “BEGIN TRAN…END TRAN” and do you suggest MyISAM or InnoDB for that ‘scores’ table?

My MySQL version is 5.0.92-log if that matters.

  • 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-01T07:32:43+00:00Added an answer on June 1, 2026 at 7:32 am

    Two queries are atomic only if they’re performed inside a transaction. And even then they’ll only be atomic for the rest of the world. Inside the transaction it’s still two completely separate operations.

    Transactions won’t protect you from two+ users doing operations on the data set. You’ll still have to establish locks on the relevant tables to prevent concurrent access.

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

Sidebar

Related Questions

I'm trying to implement a flip animation to be used in board game like
I've been trying to implement a simple component-based game object architecture using Objective-C, much
I am trying to implement a lighting effect in an HTML5/JavaScript game using tile
This is a problem I hit when trying to implement a game using the
I'm trying to add plugins to my game and what I'm trying to implement
Right, I'm trying to implement this game, http://www.helicoptergame.net/ , but I'm struggling with the
Maybe I'm just an idiot, but I've been trying to implement a game loop
I'm trying to re-implement an old Reversi board game I wrote with a bit
I am trying to implement a game using the iPhone OS 4.0 (iOS4?) SDK.
I'm trying to implement animated textures into an OpenGL game seamlessly. I made a

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.