Stop corruption - row replicate even after reboot

Hi,
I’ve built a java application which updates my mysql database with data retrieved off the local network. the mysql server is on a remove vps.

unfortunately there was a a little problem and the local pc running the program died with the windows blue screen (its a fairly old pc only used for running the program).

anyway the real problem is after i has going through some of the data i found one record (last one inserted) was replicated about 1000+ times.

I thought it odd and deleted all the replicated rows. a few minutes later another check found the same record still duplicating after a count last showed 0.

i ran this query

SELECT ikey, 
 COUNT(ikey) AS numberOfEntries
FROM tablename
GROUP BY ikey
HAVING ( COUNT(ikey) > 1 );

it showed about 20 records when i first started writing this post and just ran it now its showing just over 100.

Can anyone suggest anything to stop this please.
I’ve tried rebooting the mysql server then rebooting the whole vps but it just continues…

any ideas anyone?
thanks

Holy monkey’s *****
its still happening. i havent ran the program to add anything new in fact the pc is off.
just checked and over 200 new records exist with the same data…

I don’t know what else to do?

got it… I don’t know how but after the windows blue screen the pc auto restarted. my understanding is such that all processes that were running should have been killed with the restart, in fact the blue screen showing should mean user processes have been killed.

I just randomly got the idea to check to see if there were any instances of java running and i found one that was clocking up some 200k mb of memory after i killed it the duplicating row has stopped in its tracks and everything is all good.

Not sure how that java instance got started because i havent ran the program since the pc crashed…anyway thats another matter. issue resolved.

thanks for ur time

r937 can u elaborate please? I don’t mind i’m quite open to any suggestions that’ll improve the way i’m doing things

Sorry that might be misleading me having ikey
ikey isn’t the primary key another field already exists which is the pk
ikey is used in conjunction with the primary key to determine properties of the data in that row. the ikey is a string which is also unique in that before a row is inserted with that key from the program the database is checked to ensure a row doesn’t already exist with that ikey.

the value of the primary key isn’t repeated but no data is being inserted by my program currently but the amount of rows with this ikey keeps increasing, the auto incremented primary key has remained unique and is at 200533 as i just checked.

the last inserted row by my program had pk id of 200425 so record 200425 has been duplicated about 128 times since i last deleted them

and sorry i don’t quite get what youre askign in the second question. or at least im not sure is valid now knowing that ikey is not the pk and is in fact a string

that’s also a problem, although i guess this isn’t the time to bring it up :slight_smile:

let’s wait until after you fix your app :slight_smile:

lol ok i sent you a pm regarding this n services u provide from looking at ur website…
anyway, have u or anyone else any idea what’s going on?

What is the value of the ID which is continuously inserted?

Could it be that the table ID has reached the maximum value allowed by the column type/length?

Also, why is the ID not set as a primary key, to throw an error when this happens?