diff --git a/examples/interfaces/03.select.cpp b/examples/interfaces/03.select.cpp index a3277e078e..c58e3e98c2 100644 --- a/examples/interfaces/03.select.cpp +++ b/examples/interfaces/03.select.cpp @@ -48,6 +48,7 @@ int main() // status vector and main dispatcher ThrowStatusWrapper status(master->getStatus()); IProvider* prov = master->getDispatcher(); + IUtil* utl = master->getUtilInterface(); // declare pointers to required interfaces IAttachment* att = NULL; @@ -55,6 +56,7 @@ int main() IStatement* stmt = NULL; IMessageMetadata* meta = NULL; IMetadataBuilder* builder = NULL; + IXpbBuilder* tpb = NULL; // Interface provides access to data returned by SELECT statement IResultSet* curs = NULL; @@ -64,8 +66,13 @@ int main() // attach employee db att = prov->attachDatabase(&status, "employee", 0, NULL); - // start default transaction - tra = att->startTransaction(&status, 0, NULL); + // start read only transaction + tpb = utl->getXpbBuilder(&status, IXpbBuilder::TPB, NULL, 0); + tpb->insertTag(&status, isc_tpb_read_committed); + tpb->insertTag(&status, isc_tpb_no_rec_version); + tpb->insertTag(&status, isc_tpb_wait); + tpb->insertTag(&status, isc_tpb_read); + tra = att->startTransaction(&status, tpb->getBufferLength(&status), tpb->getBuffer(&status)); // prepare statement stmt = att->prepare(&status, tra, 0, "select last_name, first_name, phone_ext from phone_list " @@ -192,6 +199,8 @@ int main() tra->release(); if (att) att->release(); + if (tpb) + tpb->dispose(); prov->release(); status.dispose(); diff --git a/src/yvalve/utl.cpp b/src/yvalve/utl.cpp index b1371b85a0..ee313712d0 100644 --- a/src/yvalve/utl.cpp +++ b/src/yvalve/utl.cpp @@ -739,6 +739,7 @@ public: : pb(NULL), strVal(getPool()) { ClumpletReader::Kind k; + UCHAR tag = 0; const ClumpletReader::KindList* kl = NULL; switch(kind) @@ -754,6 +755,7 @@ public: break; case TPB: k = ClumpletReader::Tpb; + tag = isc_tpb_version3; break; default: fatal_exception::raiseFmt("Wrong parameters block kind %d, should be from %d to %d", kind, DPB, TPB); @@ -765,7 +767,7 @@ public: if (kl) pb = FB_NEW_POOL(getPool()) ClumpletWriter(getPool(), kl, MAX_DPB_SIZE); else - pb = FB_NEW_POOL(getPool()) ClumpletWriter(getPool(), k, MAX_DPB_SIZE); + pb = FB_NEW_POOL(getPool()) ClumpletWriter(getPool(), k, MAX_DPB_SIZE, tag); } else {