mirror of
https://github.com/gnustep/libs-sqlclient.git
synced 2025-02-15 16:11:42 +00:00
don't auto-disconnect on error
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/sqlclient/trunk@38091 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
832e22bc45
commit
9d1157b9c0
2 changed files with 13 additions and 16 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2014-09-24 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Postgres.m: An SQL exception/error should not automatically
|
||||||
|
disconnect.
|
||||||
|
|
||||||
2014-09-10 Richard Frith-Macdonald <rfm@gnu.org>
|
2014-09-10 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* SQLClient.m:
|
* SQLClient.m:
|
||||||
|
|
24
Postgres.m
24
Postgres.m
|
@ -400,10 +400,6 @@ connectQuote(NSString *str)
|
||||||
{
|
{
|
||||||
str = [NSString stringWithCString: cstr];
|
str = [NSString stringWithCString: cstr];
|
||||||
}
|
}
|
||||||
if (YES == connected)
|
|
||||||
{
|
|
||||||
[self disconnect];
|
|
||||||
}
|
|
||||||
[NSException raise: SQLException format: @"Error executing %@: %@",
|
[NSException raise: SQLException format: @"Error executing %@: %@",
|
||||||
stmt, str];
|
stmt, str];
|
||||||
}
|
}
|
||||||
|
@ -423,14 +419,14 @@ connectQuote(NSString *str)
|
||||||
{
|
{
|
||||||
NSString *n = [localException name];
|
NSString *n = [localException name];
|
||||||
|
|
||||||
if (YES == connected && [n isEqual: SQLConnectionException] == YES)
|
|
||||||
{
|
|
||||||
[self disconnect];
|
|
||||||
}
|
|
||||||
if (result != 0)
|
if (result != 0)
|
||||||
{
|
{
|
||||||
PQclear(result);
|
PQclear(result);
|
||||||
}
|
}
|
||||||
|
if (YES == connected && [n isEqual: SQLConnectionException] == YES)
|
||||||
|
{
|
||||||
|
[self disconnect];
|
||||||
|
}
|
||||||
[localException retain];
|
[localException retain];
|
||||||
[arp release];
|
[arp release];
|
||||||
[localException autorelease];
|
[localException autorelease];
|
||||||
|
@ -536,10 +532,6 @@ static unsigned int trim(char *str)
|
||||||
{
|
{
|
||||||
str = [NSString stringWithCString: cstr];
|
str = [NSString stringWithCString: cstr];
|
||||||
}
|
}
|
||||||
if (YES == connected)
|
|
||||||
{
|
|
||||||
[self disconnect];
|
|
||||||
}
|
|
||||||
[NSException raise: SQLException format: @"Error executing %@: %@",
|
[NSException raise: SQLException format: @"Error executing %@: %@",
|
||||||
stmt, str];
|
stmt, str];
|
||||||
}
|
}
|
||||||
|
@ -656,14 +648,14 @@ static unsigned int trim(char *str)
|
||||||
{
|
{
|
||||||
NSString *n = [localException name];
|
NSString *n = [localException name];
|
||||||
|
|
||||||
if (YES == connected && [n isEqual: SQLConnectionException] == YES)
|
|
||||||
{
|
|
||||||
[self disconnect];
|
|
||||||
}
|
|
||||||
if (result != 0)
|
if (result != 0)
|
||||||
{
|
{
|
||||||
PQclear(result);
|
PQclear(result);
|
||||||
}
|
}
|
||||||
|
if (YES == connected && [n isEqual: SQLConnectionException] == YES)
|
||||||
|
{
|
||||||
|
[self disconnect];
|
||||||
|
}
|
||||||
[records release];
|
[records release];
|
||||||
records = nil;
|
records = nil;
|
||||||
[localException retain];
|
[localException retain];
|
||||||
|
|
Loading…
Reference in a new issue