Author: kpvdr
Date: 2008-05-16 11:25:06 -0400 (Fri, 16 May 2008)
New Revision: 2060
Modified:
store/trunk/cpp/lib/JournalImpl.cpp
Log:
Noticed a logic bug in the last fix, this solves it
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2008-05-16 14:32:46 UTC (rev 2059)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2008-05-16 15:25:06 UTC (rev 2060)
@@ -237,18 +237,17 @@
::free(_datap);
_datap = 0;
}
+ _dlen = 0;
+ _dtok.reset();
+ _dtok.set_wstate(DataTokenImpl::ENQ);
+ _dtok.set_rid(0);
_external = false;
size_t xlen = 0;
bool transient = false;
bool done = false;
bool rid_found = false;
unsigned aio_sleep_cnt = 0;
- while (!done)
- {
- _dlen = 0;
- _dtok.reset();
- _dtok.set_wstate(DataTokenImpl::ENQ);
- _dtok.set_rid(0);
+ while (!done) {
iores res = read_data_record(&_datap, _dlen, &_xidp, xlen, transient,
_external, &_dtok);
bool rid_low = _dtok.rid() < rid;
rid_found = _dtok.rid() == rid;
@@ -264,7 +263,13 @@
ss << "; exceeded maximum wait time";
throw jexception(0, ss.str().c_str(), "JournalImpl",
"loadMsgContent");
}
- } else if (!rid_low) {
+ } else if (rid_low) {
+ // reset data token for next read
+ _dlen = 0;
+ _dtok.reset();
+ _dtok.set_wstate(DataTokenImpl::ENQ);
+ _dtok.set_rid(0);
+ } else {
std::stringstream ss;
ss << "read_data_record() returned " <<
journal::iores_str(res);
throw jexception(0, ss.str().c_str(), "JournalImpl",
"loadMsgContent");
Show replies by date