@@ -119,7 +119,9 @@ void SQLClientOracleErrorHandler()
119
119
{
120
120
if (connected == NO )
121
121
{
122
- if (database != nil && user != nil && password != nil )
122
+ if ([self database ] != nil
123
+ && [self user ] != nil
124
+ && [self password ] != nil )
123
125
{
124
126
Class c = NSClassFromString (@" CmdClient" );
125
127
@@ -135,16 +137,16 @@ void SQLClientOracleErrorHandler()
135
137
EXEC SQL END DECLARE SECTION;
136
138
137
139
/* Database is the Oracle Net identifier for the database. */
138
- database_c = [database UTF8String ];
140
+ database_c = [[ self database ] UTF8String ];
139
141
140
142
/* User and password are used to connect to the database. */
141
- user_c = [user UTF8String ];
142
- password_c = [password UTF8String ];
143
+ user_c = [[ self user ] UTF8String ];
144
+ password_c = [[ self password ] UTF8String ];
143
145
144
146
/* Client is only used to give this connection a name
145
147
* and distinguish it from other connections.
146
148
*/
147
- client_c = [client UTF8String ];
149
+ client_c = [[ self clientName ] UTF8String ];
148
150
149
151
if (c != 0 )
150
152
{
@@ -187,27 +189,27 @@ void SQLClientOracleErrorHandler()
187
189
const char *client_c;
188
190
EXEC SQL END DECLARE SECTION;
189
191
190
- if (inTransaction == YES )
192
+ if ([ self isInTransaction ] == YES )
191
193
{
192
194
[self rollback ];
193
195
}
194
196
195
- client_c = [client UTF8String ];
197
+ client_c = [[ self clientName ] UTF8String ];
196
198
197
- [self debug: @" (Oracle) Disconnecting client %@ " , client ];
199
+ [self debug: @" (Oracle) Disconnecting client %@ " , [ self clientName ] ];
198
200
199
201
/* To disconnect from the database, we issuse a COMMIT
200
202
* statement with the RELEASE option. The RELEASE option
201
203
* causes it to disconnect after the COMMIT.
202
204
*/
203
205
EXEC SQL AT :client_c COMMIT WORK RELEASE;
204
206
205
- [self debug: @" (Oracle) Disconnected client %@ " , client ];
207
+ [self debug: @" (Oracle) Disconnected client %@ " , [ self clientName ] ];
206
208
}
207
209
NS_HANDLER
208
210
{
209
211
[self error: @" (Oracle) Error disconnecting from database (%@ ): %@ " ,
210
- client , localException];
212
+ [ self clientName ] , localException];
211
213
}
212
214
NS_ENDHANDLER
213
215
connected = NO ;
@@ -246,7 +248,7 @@ void SQLClientOracleErrorHandler()
246
248
247
249
NS_DURING
248
250
{
249
- if (inTransaction == NO )
251
+ if ([ self isInTransaction ] == NO )
250
252
{
251
253
manuallyAutoCommit = YES ;
252
254
}
@@ -349,7 +351,7 @@ static unsigned int trim(char *str)
349
351
CREATE_AUTORELEASE_POOL (arp);
350
352
NSMutableArray *records;
351
353
BOOL isOpen = NO ;
352
- BOOL wasInTransaction = inTransaction ;
354
+ BOOL wasInTransaction = [ self isInTransaction ] ;
353
355
BOOL allocatedDescriptor = NO ;
354
356
355
357
length = [stmt length ];
@@ -381,10 +383,10 @@ static unsigned int trim(char *str)
381
383
allocatedDescriptor = YES ;
382
384
383
385
EXEC SQL AT :handle PREPARE myQuery from :query;
384
- if (inTransaction == NO )
386
+ if ([ self isInTransaction ] == NO )
385
387
{
386
388
/* EXEC SQL AT :handle BEGIN; */
387
- inTransaction = YES ;
389
+ _inTransaction = YES ;
388
390
}
389
391
EXEC SQL AT :handle DECLARE myCursor CURSOR FOR myQuery;
390
392
EXEC SQL AT :handle OPEN myCursor;
@@ -605,10 +607,10 @@ static unsigned int trim(char *str)
605
607
606
608
isOpen = NO ;
607
609
EXEC SQL AT :handle CLOSE myCursor;
608
- if (wasInTransaction == NO && inTransaction == YES )
610
+ if (wasInTransaction == NO && [ self isInTransaction ] == YES )
609
611
{
610
612
EXEC SQL AT :handle COMMIT;
611
- inTransaction = NO ;
613
+ _inTransaction = NO ;
612
614
}
613
615
EXEC SQL DEALLOCATE DESCRIPTOR ' myDesc' ;
614
616
allocatedDescriptor = NO ;
@@ -626,19 +628,19 @@ static unsigned int trim(char *str)
626
628
{
627
629
EXEC SQL AT :handle CLOSE myCursor;
628
630
}
629
- if (wasInTransaction == NO && inTransaction == YES )
631
+ if (wasInTransaction == NO && [ self isInTransaction ] == YES )
630
632
{
631
633
EXEC SQL AT :handle ROLLBACK;
632
- inTransaction = NO ;
634
+ _inTransaction = NO ;
633
635
}
634
636
}
635
637
NS_HANDLER
636
638
{
637
639
NSString *e = [localException name ];
638
640
639
- if (wasInTransaction == NO && inTransaction == YES )
641
+ if (wasInTransaction == NO && [ self isInTransaction ] == YES )
640
642
{
641
- inTransaction = NO ;
643
+ _inTransaction = NO ;
642
644
}
643
645
if ([e isEqual: SQLConnectionException] == YES )
644
646
{
@@ -664,7 +666,7 @@ static unsigned int trim(char *str)
664
666
665
667
if ([n isEqual: SQLConnectionException] == YES )
666
668
{
667
- inTransaction = NO ;
669
+ _inTransaction = NO ;
668
670
[self backendDisconnect ];
669
671
}
670
672
0 commit comments