Hello,

On 25/12/2010 18:08, Sylvain Pointeau wrote:

> However there is a little mistake in your documentation

>      std::vector<int>::iterator pos;
>      for(; pos != valsOut.end(); ++pos)

> it should be:
>
> for(pos = valsOut.begin(); pos != valsOut.end(); ++pos)

Thank you for catching it.
Just fixed in the repo:

http://soci.git.sourceforge.net/git/gitweb.cgi?p=soci/soci;a=commit;h=2a15cc885ff4a5c2807fb2606919e9bb3345eaf7

> and what is the purpose of the "valsOut.resize(BATCH_SIZE) ?

As explained in the documentation:

"Each call to fetch() can potentially resize the vector to a size less 
than its initial size - how often this happens depends on the underlying 
database implementation. This explains why the resize(BATCH_SIZE) 
operation is needed - it is there to ensure that each time the fetch() 
is called, the vector is ready to accept the next bunch of values. 
Without this operation, the vector might be getting smaller with 
subsequent iterations of the loop, forcing more iterations to be 
performed (because all rows will be read anyway), than really needed."

Regards,

-- 
Maciej Sobczak * www.msobczak.com * www.inspirel.com

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to