Skip to content

Commit 1b9282f

Browse files
RW PM selection
1 parent 8c02ee1 commit 1b9282f

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

dmlproc/batchinsertprocessor.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,23 @@ void BatchInsertProc::buildLastPkg(messageqcpp::ByteStream& bs)
230230
bs << rt;
231231
}
232232

233+
uint32_t BatchInsertProc::selectNextPM()
234+
{
235+
uint32_t pm;
236+
do
237+
{
238+
pm = fBatchLoader->selectNextPM();
239+
} while (pm != 0 && fWEClient->isConnectionReadonly(pm));
240+
return pm;
241+
}
233242
void BatchInsertProc::sendFirstBatch()
234243
{
235244
uint32_t firstPmId = 0;
236245
int rc = 0;
237246

238247
try
239248
{
240-
firstPmId = fBatchLoader->selectNextPM();
249+
firstPmId = selectNextPM();
241250
}
242251
catch (std::exception& ex)
243252
{
@@ -268,7 +277,7 @@ void BatchInsertProc::sendNextBatch()
268277

269278
try
270279
{
271-
fCurrentPMid = fBatchLoader->selectNextPM();
280+
fCurrentPMid = selectNextPM();
272281
}
273282
catch (std::exception& ex)
274283
{

dmlproc/batchinsertprocessor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ class BatchInsertProc
6868
void setHwm();
6969
void receiveAllMsg();
7070
void receiveOutstandingMsg();
71+
uint32_t selectNextPM();
7172

7273
private:
7374
SP_PKG fInsertPkgQueue;

0 commit comments

Comments
 (0)