If the INSERT failes because of a duplicate key, there is no need to do an UPDATE, because this record (KEY) is only some microseconds old. No worry, it works perfect since 2 years. I never saw that a SLAVE has written a record in this microseconds, where assp could has a problem - this was a theoretic consideration! But how ever 0.6.07 will have an improvement for this.
Thomas "GrayHat" <[email protected]> 02.12.2009 17:35 Bitte antworten an GrayHat <[email protected]>; Bitte antworten an ASSP development mailing list <[email protected]> An "ASSP development mailing list" <[email protected]> Kopie Thema Re: [Assp-test] Antwort: MySQL Duplicate entry problem > Because the replication in MySQL is asynchron, you as DB-admin has to > make sure that the DB components (Master & Slave) get rid of duplicate > keys. How ever, assp checks before writing a record if it has to do an > 'UPDATE' or an 'INSERT'. An UPDATE makes no problem, because the > record is locked. An INSERT could fail, if the SLAVE writes the same > record just in the moment between the existency check and the record > write of assp. sorry for jumping in barefoot but... let's say that each record has a unique key (e.g. an MD5 calculated on some "peculiar" infos); at that point it would be quite easy to solve such a conflict, I mean, the ASSP code may do something like (pseudocode) error = SQLexec( "INSERT INTO table VALUES(.....)"); if (SQL_DUP_KEY == error) { error = SQLexec("UPDATE table SET .... WHERE ..."); } if (SQL_NO_ERROR != error) { // log the error do whatever needed } or... am I missing something ? ------------------------------------------------------------------------------ Join us December 9, 2009 for the Red Hat Virtual Experience, a free event focused on virtualization and cloud computing. Attend in-depth sessions from your desk. Your couch. Anywhere. http://p.sf.net/sfu/redhat-sfdev2dev _______________________________________________ Assp-test mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/assp-test DISCLAIMER: ******************************************************* This email and any files transmitted with it may be confidential, legally privileged and protected in law and are intended solely for the use of the individual to whom it is addressed. This email was multiple times scanned for viruses. There should be no known virus in this email! ******************************************************* ------------------------------------------------------------------------------ Join us December 9, 2009 for the Red Hat Virtual Experience, a free event focused on virtualization and cloud computing. Attend in-depth sessions from your desk. Your couch. Anywhere. http://p.sf.net/sfu/redhat-sfdev2dev _______________________________________________ Assp-test mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/assp-test
