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…
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…
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.
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