@@ -1385,20 +1385,22 @@ NAN_METHOD(njsConnection::Execute)
1385
1385
baton = connection->CreateBaton (info);
1386
1386
if (!baton)
1387
1387
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 )
1402
1404
ok = ProcessBinds (info, 1 , baton);
1403
1405
if (ok && info.Length () > 3 )
1404
1406
ProcessOptions (info, 2 , baton);
@@ -1608,7 +1610,8 @@ NAN_METHOD(njsConnection::Commit)
1608
1610
baton = connection->CreateBaton (info);
1609
1611
if (!baton)
1610
1612
return ;
1611
- baton->SetDPIConnHandle (connection->dpiConnHandle );
1613
+ if (baton->error .empty ())
1614
+ baton->SetDPIConnHandle (connection->dpiConnHandle );
1612
1615
baton->QueueWork (" Commit" , Async_Commit, NULL , 1 );
1613
1616
}
1614
1617
@@ -1642,7 +1645,8 @@ NAN_METHOD(njsConnection::Rollback)
1642
1645
baton = connection->CreateBaton (info);
1643
1646
if (!baton)
1644
1647
return ;
1645
- baton->SetDPIConnHandle (connection->dpiConnHandle );
1648
+ if (baton->error .empty ())
1649
+ baton->SetDPIConnHandle (connection->dpiConnHandle );
1646
1650
baton->QueueWork (" Rollback" , Async_Rollback, NULL , 1 );
1647
1651
}
1648
1652
@@ -1676,7 +1680,8 @@ NAN_METHOD(njsConnection::Break)
1676
1680
baton = connection->CreateBaton (info);
1677
1681
if (!baton)
1678
1682
return ;
1679
- baton->SetDPIConnHandle (connection->dpiConnHandle );
1683
+ if (baton->error .empty ())
1684
+ baton->SetDPIConnHandle (connection->dpiConnHandle );
1680
1685
baton->QueueWork (" Break" , Async_Break, NULL , 1 );
1681
1686
}
1682
1687
@@ -1718,10 +1723,12 @@ NAN_METHOD(njsConnection::CreateLob)
1718
1723
Nan::ThrowError (errMsg.c_str ());
1719
1724
return ;
1720
1725
}
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
+ }
1725
1732
baton->QueueWork (" CreateLob" , Async_CreateLob, Async_AfterCreateLob, 2 );
1726
1733
}
1727
1734
0 commit comments