Remove MySQL support
This commit is contained in:
@@ -32,30 +32,6 @@ namespace Umbraco.Core.Persistence
|
||||
//
|
||||
// works in READ COMMITED, TSQL & SQLCE lock the constraint even if it does not exist, so INSERT is OK
|
||||
//
|
||||
// proper way to do it with MySQL
|
||||
// IF EXISTS (SELECT ... FROM table WHERE ... FOR UPDATE)
|
||||
// BEGIN
|
||||
// UPDATE table SET ... WHERE ...
|
||||
// END
|
||||
// ELSE
|
||||
// BEGIN
|
||||
// INSERT INTO table (...) VALUES (...)
|
||||
// END
|
||||
//
|
||||
// MySQL locks the constraint ONLY if it exists, so INSERT may fail...
|
||||
// in theory, happens in READ COMMITTED but not REPEATABLE READ
|
||||
// http://www.percona.com/blog/2012/08/28/differences-between-read-committed-and-repeatable-read-transaction-isolation-levels/
|
||||
// but according to
|
||||
// http://dev.mysql.com/doc/refman/5.0/en/set-transaction.html
|
||||
// it won't work for exact index value (only ranges) so really...
|
||||
//
|
||||
// MySQL should do
|
||||
// INSERT INTO table (...) VALUES (...) ON DUPLICATE KEY UPDATE ...
|
||||
//
|
||||
// also the lock is released when the transaction is committed
|
||||
// not sure if that can have unexpected consequences on our code?
|
||||
//
|
||||
// so... for the time being, let's do with that somewhat crazy solution below...
|
||||
// todo: use the proper database syntax, not this kludge
|
||||
|
||||
/// <summary>
|
||||
@@ -66,7 +42,7 @@ namespace Umbraco.Core.Persistence
|
||||
/// <returns>The action that executed, either an insert or an update. If an insert occurred and a PK value got generated, the poco object
|
||||
/// passed in will contain the updated value.</returns>
|
||||
/// <remarks>
|
||||
/// <para>We cannot rely on database-specific options such as MySql ON DUPLICATE KEY UPDATE or MSSQL MERGE WHEN MATCHED because SQLCE
|
||||
/// <para>We cannot rely on database-specific options because SQLCE
|
||||
/// does not support any of them. Ideally this should be achieved with proper transaction isolation levels but that would mean revisiting
|
||||
/// isolation levels globally. We want to keep it simple for the time being and manage it manually.</para>
|
||||
/// <para>We handle it by trying to update, then insert, etc. until something works, or we get bored.</para>
|
||||
@@ -89,7 +65,7 @@ namespace Umbraco.Core.Persistence
|
||||
/// <returns>The action that executed, either an insert or an update. If an insert occurred and a PK value got generated, the poco object
|
||||
/// passed in will contain the updated value.</returns>
|
||||
/// <remarks>
|
||||
/// <para>We cannot rely on database-specific options such as MySql ON DUPLICATE KEY UPDATE or MSSQL MERGE WHEN MATCHED because SQLCE
|
||||
/// <para>We cannot rely on database-specific options because SQLCE
|
||||
/// does not support any of them. Ideally this should be achieved with proper transaction isolation levels but that would mean revisiting
|
||||
/// isolation levels globally. We want to keep it simple for the time being and manage it manually.</para>
|
||||
/// <para>We handle it by trying to update, then insert, etc. until something works, or we get bored.</para>
|
||||
|
||||
Reference in New Issue
Block a user