<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: C++ Event Logging with SQLite and ODB</title>
	<link>https://codesynthesis.com/~boris/blog//2012/08/07/cxx-event-logging-sqlite-odb/</link>
	<description>Boris Kolpackov's blog about software</description>
	<pubDate>Sat, 28 Oct 2023 17:44:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: Boris Kolpackov</title>
		<link>https://codesynthesis.com/~boris/blog//2012/08/07/cxx-event-logging-sqlite-odb/#comment-2268</link>
		<author>Boris Kolpackov</author>
		<pubDate>Thu, 09 Aug 2012 18:11:10 +0000</pubDate>
		<guid>https://codesynthesis.com/~boris/blog//2012/08/07/cxx-event-logging-sqlite-odb/#comment-2268</guid>
		<description>Dave,

Yes, ODB wraps the SQLite transaction into the &lt;code&gt;odb::transaction&lt;/code&gt; RAII class. While in the article I use the one transaction per log entry approach (see the body of the &lt;code&gt;log()&lt;/code&gt; function), it is also easy to batch multiple log entries into a single transaction:

&lt;pre&gt;&lt;br /&gt;
transaction t (db.begin ());&lt;br /&gt;
&#160;&lt;br /&gt;
log (db, event (buy,&#160;&#160;&#34;INTC&#34;, 100, 25.10));&lt;br /&gt;
log (db, event (buy,&#160;&#160;&#34;AMD&#34;,&#160;&#160;200, 4.05));&lt;br /&gt;
log (db, event (buy,&#160;&#160;&#34;ARM&#34;,&#160;&#160;200, 26.25));&lt;br /&gt;
&#160;&lt;br /&gt;
t.commit ();&lt;br /&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Dave,</p>
<p>Yes, ODB wraps the SQLite transaction into the <code>odb::transaction</code> RAII class. While in the article I use the one transaction per log entry approach (see the body of the <code>log()</code> function), it is also easy to batch multiple log entries into a single transaction:</p>
<pre>
transaction t (db.begin ());
&nbsp;
log (db, event (buy,&nbsp;&nbsp;&quot;INTC&quot;, 100, 25.10));
log (db, event (buy,&nbsp;&nbsp;&quot;AMD&quot;,&nbsp;&nbsp;200, 4.05));
log (db, event (buy,&nbsp;&nbsp;&quot;ARM&quot;,&nbsp;&nbsp;200, 26.25));
&nbsp;
t.commit ();
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Johansen</title>
		<link>https://codesynthesis.com/~boris/blog//2012/08/07/cxx-event-logging-sqlite-odb/#comment-2267</link>
		<author>Dave Johansen</author>
		<pubDate>Thu, 09 Aug 2012 17:14:05 +0000</pubDate>
		<guid>https://codesynthesis.com/~boris/blog//2012/08/07/cxx-event-logging-sqlite-odb/#comment-2267</guid>
		<description>Does the ODB take care of transaction handling for you? Because if you're writing to disk then to my knowledge sqlite can only do a limited number of transactions per second ( http://www.sqlite.org/faq.html#q19 ).</description>
		<content:encoded><![CDATA[<p>Does the ODB take care of transaction handling for you? Because if you&#8217;re writing to disk then to my knowledge sqlite can only do a limited number of transactions per second ( <a href="http://www.sqlite.org/faq.html#q19" rel="nofollow">http://www.sqlite.org/faq.html#q19</a> ).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
