Commits

Tuukka Norri committed 6a5c3b2

Fixed a locking query, errors will now be logged

  • Participants
  • Parent commits 646f068

Comments (0)

Files changed (1)

Sources/BXPGTransactionHandler.m

 	return ([mConnection SSLStruct] ? YES : NO);
 }
 
+- (void) receivedLockQueryResult: (PGTSResultSet *) res
+{
+	if (! [res querySucceeded])
+		BXLogWarning (@"Unable to send lock query: %@", [res error]);
+}
+
 - (void) markLocked: (BXEntityDescription *) entity 
 	  relationAlias: (NSString *) alias
 		 fromClause: (NSString *) fromClause
 		NSString* funcname = [[mLockHandlers objectForKey: entity] lockFunctionName];
 		
 		//Lock type
-		NSString* format = @"SELECT %@ ('U', %u, %@) FROM %@ WHERE %@";
+		NSString* format = @"SELECT \"baseten\".\"%@\" ('U', %u, %@) FROM %@ WHERE %@";
 		if (willDelete)
-			format = @"SELECT %@ ('D', %u, %@) FROM %@ WHERE %@";
+			format = @"SELECT \"baseten\".\"%@\" ('D', %u, %@) FROM %@ WHERE %@";
 		
 		//Table
 		NSError* localError = nil;
 		
 		//Execute the query.
 		NSString* query = [NSString stringWithFormat: format, funcname, 0, fieldList, fromClause, whereClause];
-		[notifyConnection sendQuery: query delegate: nil callback: NULL parameterArray: parameters]; 			
+		[notifyConnection sendQuery: query delegate: self callback: @selector (receivedLockQueryResult:) parameterArray: parameters]; 			
 	}
 }