diff --git a/ChangeLog b/ChangeLog index 221ce0f..6c63fb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-09-24 Richard Frith-Macdonald + + * Postgres.m: An SQL exception/error should not automatically + disconnect. + 2014-09-10 Richard Frith-Macdonald * SQLClient.m: diff --git a/Postgres.m b/Postgres.m index 2b22902..fc55dc3 100644 --- a/Postgres.m +++ b/Postgres.m @@ -400,10 +400,6 @@ connectQuote(NSString *str) { str = [NSString stringWithCString: cstr]; } - if (YES == connected) - { - [self disconnect]; - } [NSException raise: SQLException format: @"Error executing %@: %@", stmt, str]; } @@ -423,14 +419,14 @@ connectQuote(NSString *str) { NSString *n = [localException name]; - if (YES == connected && [n isEqual: SQLConnectionException] == YES) - { - [self disconnect]; - } if (result != 0) { PQclear(result); } + if (YES == connected && [n isEqual: SQLConnectionException] == YES) + { + [self disconnect]; + } [localException retain]; [arp release]; [localException autorelease]; @@ -536,10 +532,6 @@ static unsigned int trim(char *str) { str = [NSString stringWithCString: cstr]; } - if (YES == connected) - { - [self disconnect]; - } [NSException raise: SQLException format: @"Error executing %@: %@", stmt, str]; } @@ -656,14 +648,14 @@ static unsigned int trim(char *str) { NSString *n = [localException name]; - if (YES == connected && [n isEqual: SQLConnectionException] == YES) - { - [self disconnect]; - } if (result != 0) { PQclear(result); } + if (YES == connected && [n isEqual: SQLConnectionException] == YES) + { + [self disconnect]; + } [records release]; records = nil; [localException retain];