@@ -449,7 +449,7 @@ Handle<Value> Pool::GetConnection(const Arguments& args)
449
449
NJS_GET_CALLBACK ( callback, args );
450
450
451
451
Pool *njsPool = ObjectWrap::Unwrap<Pool>(args.This ());
452
- connectionBaton *connBaton = new connectionBaton ();
452
+ poolBaton *connBaton = new poolBaton ();
453
453
connBaton->cb = Persistent<Function>::New ( callback );
454
454
455
455
NJS_CHECK_NUMBER_OF_ARGS ( connBaton->error , args, 1 , 1 , exitGetConnection );
@@ -459,8 +459,7 @@ Handle<Value> Pool::GetConnection(const Arguments& args)
459
459
connBaton->error = NJSMessages::getErrorMsg ( errInvalidPool );
460
460
goto exitGetConnection;
461
461
}
462
- connBaton->dpipool = njsPool->dpipool_ ;
463
- connBaton->oracledb = njsPool->oracledb_ ;
462
+ connBaton->njspool = njsPool;
464
463
connBaton->connClass = njsPool->oracledb_ ->getConnectionClass ();
465
464
466
465
exitGetConnection:
@@ -485,13 +484,13 @@ Handle<Value> Pool::GetConnection(const Arguments& args)
485
484
*/
486
485
void Pool::Async_GetConnection (uv_work_t *req)
487
486
{
488
- connectionBaton *connBaton = (connectionBaton *)req->data ;
487
+ poolBaton *connBaton = (poolBaton *)req->data ;
489
488
if (!(connBaton->error ).empty ()) goto exitAsyncGetConnection;
490
489
491
490
try
492
491
{
493
- connBaton->dpiconn = connBaton-> dpipool -> getConnection (
494
- connBaton-> connClass);
492
+ connBaton->dpiconn = connBaton-> njspool -> dpipool_ ->
493
+ getConnection ( connBaton-> connClass);
495
494
}
496
495
catch (dpi::Exception &e)
497
496
{
@@ -516,7 +515,7 @@ void Pool::Async_GetConnection(uv_work_t *req)
516
515
void Pool::Async_AfterGetConnection (uv_work_t *req)
517
516
{
518
517
HandleScope scope;
519
- connectionBaton *connBaton = (connectionBaton *)req->data ;
518
+ poolBaton *connBaton = (poolBaton *)req->data ;
520
519
v8::TryCatch tc;
521
520
Handle<Value> argv[2 ];
522
521
if (!(connBaton->error ).empty ())
@@ -530,8 +529,8 @@ void Pool::Async_AfterGetConnection(uv_work_t *req)
530
529
Handle<Object> connection = Connection::connectionTemplate_s->
531
530
GetFunction ()-> NewInstance ();
532
531
(ObjectWrap::Unwrap<Connection> (connection))->
533
- setConnection ( connBaton->dpiconn ,
534
- connBaton->oracledb );
532
+ setConnection ( connBaton->dpiconn ,
533
+ connBaton->njspool -> oracledb_ );
535
534
argv[1 ] = connection;
536
535
}
537
536
node::MakeCallback (Context::GetCurrent ()->Global (),
@@ -559,7 +558,7 @@ Handle<Value> Pool::Terminate(const Arguments& args )
559
558
NJS_GET_CALLBACK ( callback, args );
560
559
561
560
Pool *njsPool = ObjectWrap::Unwrap<Pool>(args.This ());
562
- connectionBaton *terminateBaton = new connectionBaton ();
561
+ poolBaton *terminateBaton = new poolBaton ();
563
562
terminateBaton->cb = Persistent<Function>::New ( callback );
564
563
565
564
NJS_CHECK_NUMBER_OF_ARGS ( terminateBaton->error , args, 1 , 1 , exitTerminate );
@@ -569,8 +568,7 @@ Handle<Value> Pool::Terminate(const Arguments& args )
569
568
terminateBaton->error = NJSMessages::getErrorMsg ( errInvalidPool );
570
569
goto exitTerminate;
571
570
}
572
- terminateBaton->dpipool = njsPool->dpipool_ ;
573
- terminateBaton->isPoolValid = &(njsPool->isValid_ );
571
+ terminateBaton->njspool = njsPool;
574
572
575
573
exitTerminate:
576
574
terminateBaton->req .data = (void *)terminateBaton;
@@ -594,12 +592,12 @@ Handle<Value> Pool::Terminate(const Arguments& args )
594
592
*/
595
593
void Pool::Async_Terminate (uv_work_t *req)
596
594
{
597
- connectionBaton *terminateBaton = (connectionBaton *)req->data ;
595
+ poolBaton *terminateBaton = (poolBaton *)req->data ;
598
596
if (!terminateBaton->error .empty ()) goto exitAsyncTerminate;
599
597
600
598
try
601
599
{
602
- terminateBaton-> dpipool -> terminate ();
600
+ terminateBaton-> njspool-> dpipool_ -> terminate ();
603
601
}
604
602
catch (dpi::Exception& e)
605
603
{
@@ -620,7 +618,7 @@ void Pool::Async_Terminate(uv_work_t *req)
620
618
void Pool::Async_AfterTerminate (uv_work_t *req)
621
619
{
622
620
HandleScope scope;
623
- connectionBaton *terminateBaton = (connectionBaton *)req->data ;
621
+ poolBaton *terminateBaton = (poolBaton *)req->data ;
624
622
625
623
v8::TryCatch tc;
626
624
@@ -633,7 +631,8 @@ void Pool::Async_AfterTerminate(uv_work_t *req)
633
631
else
634
632
{
635
633
argv[0 ] = Undefined ();
636
- *(terminateBaton->isPoolValid ) = false ;
634
+ // pool is not valid after terminate succeeds.
635
+ terminateBaton-> njspool-> isValid_ = false ;
637
636
}
638
637
639
638
node::MakeCallback ( Context::GetCurrent ()->Global (),
0 commit comments