@@ -232,7 +232,8 @@ class Manager<T : Object> {
s.add(" WHERE ");
addKeys(s, i);
// will force sync
- unsafeObject(s.toString(),true);
+ if( unsafeObject(s.toString(),true) != i )
+ throw "Could not lock object (was deleted ?); try restarting transaction";
}
function objectToString( it : T ) : String {
@@ -27,7 +27,7 @@ package sys.db;
class Transaction {
public static function isDeadlock(e : Dynamic) {
- return Std.is(e,String) && (~/Deadlock found/.match(e) || ~/Lock wait timeout/.match(e));
+ return Std.is(e,String) && ~/try restarting transaction/.match(e);
private static function runMainLoop(mainFun,logError,count) {