@@ -189,9 +189,9 @@ sword begin_timelimit(ora_con_t* con, int connect)
189
189
}
190
190
191
191
192
- static sword remap_status (ora_con_t * con , sword status )
192
+ static sword remap_status (ora_con_t * con , sword status , sword * errcode )
193
193
{
194
- sword code ;
194
+ sword code = 0 ;
195
195
196
196
if ( status == OCI_ERROR
197
197
&& OCIErrorGet (con -> errhp , 1 , NULL , & code ,
@@ -200,6 +200,7 @@ static sword remap_status(ora_con_t* con, sword status)
200
200
{
201
201
status = OCI_STILL_EXECUTING ;
202
202
}
203
+ if (errcode ) * errcode = code ;
203
204
return status ;
204
205
}
205
206
@@ -214,7 +215,7 @@ int wait_timelimit(ora_con_t* con, sword status)
214
215
if (!cur_asynch_mode )
215
216
return 0 ;
216
217
217
- if (remap_status (con , status ) != OCI_STILL_EXECUTING )
218
+ if (remap_status (con , status , NULL ) != OCI_STILL_EXECUTING )
218
219
return 0 ;
219
220
220
221
gettimeofday (& cur , NULL );
@@ -230,12 +231,12 @@ int wait_timelimit(ora_con_t* con, sword status)
230
231
int done_timelimit (ora_con_t * con , sword status )
231
232
{
232
233
int ret = 0 ;
234
+ sword code ;
233
235
234
236
if (!cur_asynch_mode )
235
237
return 0 ;
236
238
237
- if (remap_status (con , status ) == OCI_STILL_EXECUTING ) {
238
- sword code ;
239
+ if (remap_status (con , status , & code ) == OCI_STILL_EXECUTING ) {
239
240
240
241
status = OCIBreak (con -> svchp , con -> errhp );
241
242
if (status != OCI_SUCCESS )
@@ -255,6 +256,9 @@ int done_timelimit(ora_con_t* con, sword status)
255
256
db_oracle_error (con , status ));
256
257
db_oracle_disconnect (con );
257
258
++ ret ;
259
+ } else if (db_oracle_connection_lost (code )) {
260
+ db_oracle_disconnect (con );
261
+ cur_asynch_mode = 0 ;
258
262
} else {
259
263
status = change_mode (con );
260
264
if (status != OCI_SUCCESS ) {
0 commit comments