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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:18:09+00:00 2026-06-12T05:18:09+00:00

We have a database that has more than 70 tables with more than 10k

  • 0

We have a database that has more than 70 tables with more than 10k of users. One of the tables in the database is to keep recording of user’s latest actions/changes in order to keep them pending until the gameweek finishes (Football matches), let’s call this table ‘Substitute’.

However, every week when we advance the system (apply changes) at the end of gameweek, we check to see if there’s any duplicated data stored regarding user’s changes (we have noticed that a while ago), and remove them manually from the database.

The rows have primary keys (which is not duplicated) only the data is duplicated. It’s like the insert query is being fired twice. (not sure about this or why)

Example: Let’s say the user has a team of football players (11 on the field and 4 substitutes)
when the user chooses player and clicks substitute, that player (on the field) will be exchanged with the one who’s in on the bench (Substitute). This process will happen immediately without the need of user to save (JavaScript). But, it not be saved in the team details, instead, it will be saved in the Substitute table that keep track of changes.

User wants to remove player 1 and enter player 12 (1->12). For the first step the system will record

id   Team   from_player  to_player
0       x         1           12

And if the user do another substitution

id   Team   from_player  to_player
0      x        1           12
1      x        2           13

And when the user substitute back the player (12->1) that record will be deleted(1->12), since the user substituted back the player and the later subs cancels the first.

id   Team   from_player  to_player
1     x         2           13

But SOMETIMES it record that row more than once

id   Team   from_player  to_player
0       x      1            12
1       x      1            12
2       x      1            12
3       x      2            13

Or the duplicate could be in between

id   Team   from_player  to_player
0      x         1          2
1      x         2          13
2      x         1          2
3      x         1          2

N.B This happens only to around 10-100 users every week, even though there are more than 10k users registered in our database.

So what do you think is causing the problem?
I don’t want to use INSERT IGNORE, I want to find the root of the problem and stop it.

So basically, my questions are:

1- Is it likely to be a server or client side problem?

2- Could ajax code be called/fired twice under certain circumstances?

3- Could be there an error in the sql server where it executes the same query twice?

Really appreciate your help.

UPDATE:

4- If the problem is with the client side, how i inspect it? Any suggested way?

For those who ask, what does happen when the user subs back the same player.
Let’s say this is part of the original players stetting.

                       | Original Status | After First Subs|After Second Subs|
                       |                 |                 |                 |
    On the field       |      p1         |        P12      |       P1        |
-----------------------|-----------------|-----------------|-----------------|
                       |                 |                 |                 |
    Subs(at the bench) |      p12        |        P1       |       P12       |
                       |                 |                 |                 |

Original Status p1 on the field, p12 on the bench (substitute)
Record of actions:
s1- P1->P12
Status= P12 on the field. P1 on the bench

s2- P12->P1
Status= P1 back on the field. P12 back to the bench.

Note that s2 wont be recorded, but, s1 will be deleted. it’s like A * -1, and then -A * -1 again. The will cancel each other.

  • 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-12T05:18:10+00:00Added an answer on June 12, 2026 at 5:18 am

    ajax mite be called more than once, tried inspecting using your firebug. you might need to disable your substitute method until the success flag is up.

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

Sidebar

Related Questions

I have a database that has two tables, one of which contains a foreign
I have one database that has a bigger size than expected, how can I
I have a database that has around 10k records and some of them contain
I have a database that has 16 tables, but only four are relevant to
I have a database that has node & nodetype tables. Nodes table NodeID ParentNodeID
I have movie database that has these tables: new_movies, ratings, critic_ratings, colors I'm trying
Ok I have a user form that has values submitted to the database. My
I have a database that has a table email_eml that stores 3 attributes name_eml,
I have a database that has the following columns: ------------------- id|domain|hit_count ------------------- And I
I have a mysql database that has text stored in it with non encoded

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.