Re: [Seed7-users] Greetings, new in the list
Interpreter and compiler for the Seed7 programming language.
Brought to you by:
thomas_mertes
From: Thomas M. <tho...@gm...> - 2016-05-26 07:59:02
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>Hi, thank you for your interest in Seed7.</div> <div>I am pleased to hear such a positive feedback.</div> <div> </div> <div>Regarding your question. I am not an SQLite expert, but years ago I did some</div> <div>performance measurements with SQLite (not with Seed7 but with C++). With the</div> <div>measurements I found out that SQLite is much faster when it just works in</div> <div>memory without a file. Opening an in memory SQLite database in Seed7</div> <div>is done with:</div> <div> </div> <div> openDatabase(DB_SQLITE, "", "", "")</div> <div> </div> <div>The C interface of SQLite (and maybe also Tcl) uses the name ":memory:" to open</div> <div>an in memory database. So maybe your Tcl example works in memory while the</div> <div>Seed7 example does not.</div> <div> </div> <div>With short googling about SQLite autocommit I found this explanation:</div> <div>https://www.sqlite.org/c3ref/get_autocommit.html</div> <div>It seems that autocommit is on until you are inside a transaktion.</div> <div>Transaktions are explained here:</div> <div>http://www.tutorialspoint.com/sqlite/sqlite_transactions.htm</div> <div>The commit function in the Seed7 driver for SQLite is currently a noop, so</div> <div> </div> <div>commit(db)</div> <div> </div> <div>will currently not work for a SQLite database but the following should work:</div> <div>execute(db, "BEGIN");</div> <div>execute(db, "COMMIT");</div> <div> <div> </div> <div>Different databases have different behavior regarding commit and transaktions.</div> <div>So maybe Tcl always starts a transaktion without telling you. This could be a way</div> <div>to emulate that autocommit is switched off. If that works the Seed7 interface</div> <div>could do that also. I general I want to provide the same behavior for all databases.</div> <div>So it depends how the other databases handle autocommit and transactions.</div> <div> </div> <div>I hope that I could help you.</div> <div> </div> <div>Regards</div> <div>Thomas Mertes</div> </div> </div></div></body></html> |