If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Data Integrity Issue

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-04-10, 01:44
bobage24 bobage24 is offline
Registered User
 
Join Date: Mar 2010
Posts: 3
Data Integrity Issue

I have a very popular website which uses a mysql database. There seems to be an issue with the database integrity as some of the information inserted and update are becoming corrupted when the server is under heavy load. One of the problems I am experiencing is some of the rows data being inserted or updated is cut short or completely left out. Other problems are with a marketplace in which two people who buy the same exact item at the same exact time. When this happens, both people lose their money, but only one person is getting the item. The site is programmed in PHP and the table uses the MYISAM storage engine. The problem with the missing or corrupt insert and update data happens about once a day, and the marketplace issue has only happened once so far, but I am trying to track down the cause or causes. Any and all suggestions are greatly appreciated.

Last edited by bobage24; 03-04-10 at 02:21.
Reply With Quote
  #2 (permalink)  
Old 03-04-10, 02:08
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
the odds are approximately 937,000 to 1 that the problem lies in the php code and not in the mysql server

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 03-04-10, 02:13
bobage24 bobage24 is offline
Registered User
 
Join Date: Mar 2010
Posts: 3
Quote:
Originally Posted by r937 View Post
the odds are approximately 937,000 to 1 that the problem lies in the php code and not in the mysql server

Thanks, at least that gives me a starting point. Here's the thing, before the site became very popular, I had no problems with the database.

Last edited by bobage24; 03-04-10 at 02:27.
Reply With Quote
  #4 (permalink)  
Old 03-04-10, 02:35
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,246
still sounds like the PHP code
check for row locks
check for how a product migrates from being selected by a user to being purchased
check if there are any retrospective checks done after the user goes tto he checkout to make sure the product is still available
bear in mind you could be in very dodgy territory if you complete a sale and then subsequently don't have the goods.. you could be in breach of contract.
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #5 (permalink)  
Old 03-04-10, 02:46
bobage24 bobage24 is offline
Registered User
 
Join Date: Mar 2010
Posts: 3
Quote:
Originally Posted by healdem View Post
still sounds like the PHP code
check for row locks
check for how a product migrates from being selected by a user to being purchased
check if there are any retrospective checks done after the user goes tto he checkout to make sure the product is still available
bear in mind you could be in very dodgy territory if you complete a sale and then subsequently don't have the goods.. you could be in breach of contract.

Thanks, I will give those a shot. I do check to make sure the item hasn't yet been sold when completing the purchase with a query, and then if the item is still available, I go ahead and update the database. This issue with the market place has happened once so far, and I track the time of the purchases too, and they both occurred at the exact same second.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On