+2007-09-27 Helge Hess <helge.hess@opengroupware.org>
+
+ * PostgreSQL72Context.m: changed to use -evaluateExpressionX: for
+ transaction queries, log error exceptions (v4.7.51)
+
2007-06-09 Helge Hess <helge.hess@opengroupware.org>
* added NSNumber+ExprValue.m which returns 0/1 for bool values on
PostgreSQL72Context.m
Copyright (C) 1999 MDlink online service center GmbH and Helge Hess
+ Copyright (C) 2007 Helge Hess
Author: Helge Hess (helge@mdlink.de)
}
- (BOOL)primaryBeginTransaction {
- BOOL result;
-
- result = [[[channels lastObject]
- nonretainedObjectValue]
- evaluateExpression:@"BEGIN TRANSACTION"];
-
- return result;
+ NSException *error;
+
+ error = [[[channels lastObject]
+ nonretainedObjectValue]
+ evaluateExpressionX:@"BEGIN TRANSACTION"];
+ if (error == nil)
+ return YES;
+
+ NSLog(@"%s: could not begin transaction: %@", __PRETTY_FUNCTION__, error);
+ return NO;
}
- (BOOL)primaryCommitTransaction {
- BOOL result;
+ NSException *error;
- result = [[[channels lastObject]
- nonretainedObjectValue]
- evaluateExpression:@"COMMIT TRANSACTION"];
+ error = [[[channels lastObject]
+ nonretainedObjectValue]
+ evaluateExpressionX:@"COMMIT TRANSACTION"];
- return result;
+ if (error == nil)
+ return YES;
+
+ NSLog(@"%s: could not commit transaction: %@", __PRETTY_FUNCTION__, error);
+ return NO;
}
- (BOOL)primaryRollbackTransaction {
- BOOL result;
+ NSException *error;
+
+ error = [[[channels lastObject]
+ nonretainedObjectValue]
+ evaluateExpressionX:@"ROLLBACK TRANSACTION"];
- result = [[[channels lastObject]
- nonretainedObjectValue]
- evaluateExpression:@"ROLLBACK TRANSACTION"];
- return result;
+ if (error == nil)
+ return YES;
+
+ NSLog(@"%s: could not rollback transaction: %@", __PRETTY_FUNCTION__, error);
+ return NO;
}
- (BOOL)canNestTransactions {
return NO;
}
-// NSCopying methods
+/* NSCopying methods */
- (id)copyWithZone:(NSZone *)zone {
+ // called when the object is used in some datastructures?
return [self retain];
}