@@ -1385,20 +1385,22 @@ NAN_METHOD(njsConnection::Execute)
13851385 baton = connection->CreateBaton (info);
13861386 if (!baton)
13871387 return ;
1388- baton->sql = sql;
1389- baton->SetDPIConnHandle (connection->dpiConnHandle );
1390- baton->jsOracledb .Reset (connection->jsOracledb );
1391- oracledb = baton->GetOracledb ();
1392- baton->maxRows = oracledb->getMaxRows ();
1393- baton->prefetchRows = oracledb->getPrefetchRows ();
1394- oracledb->SetFetchAsStringTypesOnBaton (baton);
1395- oracledb->SetFetchAsBufferTypesOnBaton (baton);
1396- baton->outFormat = oracledb->getOutFormat ();
1397- baton->autoCommit = oracledb->getAutoCommit ();
1398- baton->extendedMetaData = oracledb->getExtendedMetaData ();
1399- baton->getRS = false ;
1400- bool ok = true ;
1401- if (info.Length () > 2 )
1388+ bool ok = baton->error .empty ();
1389+ if (ok) {
1390+ baton->sql = sql;
1391+ baton->SetDPIConnHandle (connection->dpiConnHandle );
1392+ baton->jsOracledb .Reset (connection->jsOracledb );
1393+ oracledb = baton->GetOracledb ();
1394+ baton->maxRows = oracledb->getMaxRows ();
1395+ baton->prefetchRows = oracledb->getPrefetchRows ();
1396+ oracledb->SetFetchAsStringTypesOnBaton (baton);
1397+ oracledb->SetFetchAsBufferTypesOnBaton (baton);
1398+ baton->outFormat = oracledb->getOutFormat ();
1399+ baton->autoCommit = oracledb->getAutoCommit ();
1400+ baton->extendedMetaData = oracledb->getExtendedMetaData ();
1401+ baton->getRS = false ;
1402+ }
1403+ if (ok && info.Length () > 2 )
14021404 ok = ProcessBinds (info, 1 , baton);
14031405 if (ok && info.Length () > 3 )
14041406 ProcessOptions (info, 2 , baton);
@@ -1608,7 +1610,8 @@ NAN_METHOD(njsConnection::Commit)
16081610 baton = connection->CreateBaton (info);
16091611 if (!baton)
16101612 return ;
1611- baton->SetDPIConnHandle (connection->dpiConnHandle );
1613+ if (baton->error .empty ())
1614+ baton->SetDPIConnHandle (connection->dpiConnHandle );
16121615 baton->QueueWork (" Commit" , Async_Commit, NULL , 1 );
16131616}
16141617
@@ -1642,7 +1645,8 @@ NAN_METHOD(njsConnection::Rollback)
16421645 baton = connection->CreateBaton (info);
16431646 if (!baton)
16441647 return ;
1645- baton->SetDPIConnHandle (connection->dpiConnHandle );
1648+ if (baton->error .empty ())
1649+ baton->SetDPIConnHandle (connection->dpiConnHandle );
16461650 baton->QueueWork (" Rollback" , Async_Rollback, NULL , 1 );
16471651}
16481652
@@ -1676,7 +1680,8 @@ NAN_METHOD(njsConnection::Break)
16761680 baton = connection->CreateBaton (info);
16771681 if (!baton)
16781682 return ;
1679- baton->SetDPIConnHandle (connection->dpiConnHandle );
1683+ if (baton->error .empty ())
1684+ baton->SetDPIConnHandle (connection->dpiConnHandle );
16801685 baton->QueueWork (" Break" , Async_Break, NULL , 1 );
16811686}
16821687
@@ -1718,10 +1723,12 @@ NAN_METHOD(njsConnection::CreateLob)
17181723 Nan::ThrowError (errMsg.c_str ());
17191724 return ;
17201725 }
1721- baton->jsOracledb .Reset (connection->jsOracledb );
1722- baton->SetDPIConnHandle (connection->dpiConnHandle );
1723- baton->protoILob = new njsProtoILob ();
1724- baton->protoILob ->dataType = (njsDataType) lobType;
1726+ if (baton->error .empty ()) {
1727+ baton->jsOracledb .Reset (connection->jsOracledb );
1728+ baton->SetDPIConnHandle (connection->dpiConnHandle );
1729+ baton->protoILob = new njsProtoILob ();
1730+ baton->protoILob ->dataType = (njsDataType) lobType;
1731+ }
17251732 baton->QueueWork (" CreateLob" , Async_CreateLob, Async_AfterCreateLob, 2 );
17261733}
17271734
0 commit comments