mirror of
https://github.com/gnustep/libs-sqlclient.git
synced 2025-02-19 10:00:59 +00:00
Bugfix for occasional crash executing query.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/sqlclient/trunk@24231 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
07b82dba68
commit
08456b4a80
2 changed files with 13 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2006-12-24 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* JDBC.m: Don't store pointer to jni information in local variable
|
||||||
|
until after we have opened the connection to the database, or we
|
||||||
|
may be using a null pointer and generate a crash.
|
||||||
|
|
||||||
2006-12-22 Richard Frith-Macdonald <rfm@gnu.org>
|
2006-12-22 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* configure.ac: save/restore LIBS after jdbc check so that other
|
* configure.ac: save/restore LIBS after jdbc check so that other
|
||||||
|
|
9
JDBC.m
9
JDBC.m
|
@ -1089,7 +1089,7 @@ NSLog(@"CONNECT '%@', '%@', '%@'",
|
||||||
CREATE_AUTORELEASE_POOL(arp);
|
CREATE_AUTORELEASE_POOL(arp);
|
||||||
NSString *stmt = [info objectAtIndex: 0];
|
NSString *stmt = [info objectAtIndex: 0];
|
||||||
JNIEnv *env = SQLClientJNIEnv();
|
JNIEnv *env = SQLClientJNIEnv();
|
||||||
JInfo *ji = (JInfo*)extra;
|
JInfo *ji;
|
||||||
|
|
||||||
if ([stmt length] == 0)
|
if ([stmt length] == 0)
|
||||||
{
|
{
|
||||||
|
@ -1121,6 +1121,8 @@ NSLog(@"CONNECT '%@', '%@', '%@'",
|
||||||
[self name], stmt];
|
[self name], stmt];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ji = (JInfo*)extra;
|
||||||
|
|
||||||
if ([info count] > 1)
|
if ([info count] > 1)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
@ -1168,6 +1170,7 @@ NSLog(@"CONNECT '%@', '%@', '%@'",
|
||||||
{
|
{
|
||||||
if (_inTransaction == NO)
|
if (_inTransaction == NO)
|
||||||
{
|
{
|
||||||
|
ji = (JInfo*)extra;
|
||||||
// Not in a transaction ... rollback to clear error state
|
// Not in a transaction ... rollback to clear error state
|
||||||
(*env)->CallVoidMethod (env, ji->connection, ji->rollback);
|
(*env)->CallVoidMethod (env, ji->connection, ji->rollback);
|
||||||
JExceptionClear (env);
|
JExceptionClear (env);
|
||||||
|
@ -1193,7 +1196,7 @@ NSLog(@"CONNECT '%@', '%@', '%@'",
|
||||||
NSMutableArray *records = nil;
|
NSMutableArray *records = nil;
|
||||||
CREATE_AUTORELEASE_POOL(arp);
|
CREATE_AUTORELEASE_POOL(arp);
|
||||||
JNIEnv *env = SQLClientJNIEnv();
|
JNIEnv *env = SQLClientJNIEnv();
|
||||||
JInfo *ji = (JInfo*)extra;
|
JInfo *ji;
|
||||||
|
|
||||||
if ([stmt length] == 0)
|
if ([stmt length] == 0)
|
||||||
{
|
{
|
||||||
|
@ -1229,6 +1232,8 @@ NSLog(@"CONNECT '%@', '%@', '%@'",
|
||||||
[self name], stmt];
|
[self name], stmt];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ji = (JInfo*)extra;
|
||||||
|
|
||||||
result = (*env)->CallObjectMethod (env, ji->statement, ji->executeQuery,
|
result = (*env)->CallObjectMethod (env, ji->statement, ji->executeQuery,
|
||||||
JStringFromNSString(env, stmt));
|
JStringFromNSString(env, stmt));
|
||||||
JException (env);
|
JException (env);
|
||||||
|
|
Loading…
Reference in a new issue