@@ -48,13 +48,15 @@ int main()
4848 // status vector and main dispatcher
4949 ThrowStatusWrapper status (master->getStatus ());
5050 IProvider* prov = master->getDispatcher ();
51+ IUtil* utl = master->getUtilInterface ();
5152
5253 // declare pointers to required interfaces
5354 IAttachment* att = NULL ;
5455 ITransaction* tra = NULL ;
5556 IStatement* stmt = NULL ;
5657 IMessageMetadata* meta = NULL ;
5758 IMetadataBuilder* builder = NULL ;
59+ IXpbBuilder* tpb = NULL ;
5860
5961 // Interface provides access to data returned by SELECT statement
6062 IResultSet* curs = NULL ;
@@ -64,8 +66,13 @@ int main()
6466 // attach employee db
6567 att = prov->attachDatabase (&status, " employee" , 0 , NULL );
6668
67- // start default transaction
68- tra = att->startTransaction (&status, 0 , NULL );
69+ // start read only transaction
70+ tpb = utl->getXpbBuilder (&status, IXpbBuilder::TPB, NULL , 0 );
71+ tpb->insertTag (&status, isc_tpb_read_committed);
72+ tpb->insertTag (&status, isc_tpb_no_rec_version);
73+ tpb->insertTag (&status, isc_tpb_wait);
74+ tpb->insertTag (&status, isc_tpb_read);
75+ tra = att->startTransaction (&status, tpb->getBufferLength (&status), tpb->getBuffer (&status));
6976
7077 // prepare statement
7178 stmt = att->prepare (&status, tra, 0 , " select last_name, first_name, phone_ext from phone_list "
@@ -192,6 +199,8 @@ int main()
192199 tra->release ();
193200 if (att)
194201 att->release ();
202+ if (tpb)
203+ tpb->dispose ();
195204
196205 prov->release ();
197206 status.dispose ();
0 commit comments