Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: [GENERAL] "timer" script from SAMS book or equivalent?

From: John Wells <jb(at)sourceillustrated.com>
Date: Wed Oct 10 2007 - 08:43:29 EDT


Could someone explain to me how the connection is initialized below? I'm re-writing the script in Ruby...but this is a stumbling block for me in the way the C++ libs work. Does the library initial conn automagically? How would one emulate this in another language...would it be to run it as the postgres user and connection to template1?

Thanks,
John

int main( int argc, char * argv[] )
{

   // how is this being initialized?
   connection conn;

   work tran1( conn, "getBegValues" );

   const result & begTupleValues = getTupleValues( tran1, argc > 2 ? argv[2] : 0 );

   const result & begBlockValues = getBlockValues( tran1, argc > 2 ? argv[2] : 0 );

   const result & ignore = tran1.exec( argv[1] );

Do you need help?X

   tran1.commit();

   sleep( 1 );

   work tran2( conn, "getEndValues" );

   const result & endTupleValues = getTupleValues( tran2, argc > 2 ? argv[2] : 0 );

   const result & endBlockValues = getBlockValues( tran2, argc > 2 ? argv[2] : 0 );

   printDeltas( begTupleValues, endTupleValues, begBlockValues, endBlockValues );    

}

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org/ Received on Wed Oct 10 08:47:14 2007

Do you need more help?X

This archive was generated by hypermail 2.1.8 : Mon Jun 16 2008 - 18:09:14 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library