<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Am 01.07.2020 um 12:54 schrieb Michael
Van Canneyt via lazarus:<br>
</div>
<blockquote type="cite"
cite="mid:alpine.DEB.2.21.2007011250090.12440@home">
<br>
<br>
On Wed, 1 Jul 2020, Luca Olivetti via lazarus wrote:
<br>
<br>
<blockquote type="cite">El 1/7/20 a les 0:40, R.Smith via lazarus
ha escrit:
<br>
<blockquote type="cite">On 2020/06/30 22:52, Special via lazarus
wrote:
<br>
<blockquote type="cite">Hi, Ryan,
<br>
<br>
I followed your advice and removed XTransaction and all
references to it from TestButtonClick. But now I get an
exception with the message "Transaction not set". Any hint?
<br>
Regards -- Joe
<br>
</blockquote>
<br>
I'm sorry, the previous problem was SQLite-related, which I'm
initimately familiar with, but this one seems to be a Lazarus
DB component requirement which I'm not so much familiar with,
but probably has an easy solution someone here might know
about.
<br>
<br>
The question becomes: How to execute a query, without a
transaction being set, using SQLdb in Lazarus?
<br>
</blockquote>
<br>
I use zeos instead of sqldb. Most probably it's my fault and it
could be solved by doing what Michael said (use stoUseImplicit),
but when I tried to use sqldb with sqlite, as long as I kept the
dataset open (to show the data in a dbgrid) the table was locked
and couldn't be modified by a different thread/process.
<br>
</blockquote>
<br>
The stoUseImplicit is one way to solve this.
<br>
<br>
An alternative was to disable the need to keep an active
transaction using
<br>
TSQLQuery.Options : add sqoKeepOpenOnCommit.
<br>
<br>
see
<br>
<a class="moz-txt-link-freetext" href="https://www.freepascal.org/docs-html/current/fcl/sqldb/tsqlqueryoptions.html">https://www.freepascal.org/docs-html/current/fcl/sqldb/tsqlqueryoptions.html</a>
<br>
<br>
Then you can do
<br>
<br>
Dataset.open;
<br>
MyTransaction.Commit;
<br>
<br>
And the table will not be locked.
<br>
<br>
Michael.<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
</blockquote>
<br>
Hi, Ryan, Luca, Michael and all others,<br>
<br>
to Transaction.Options I added 'stoUseImplicit'. Now I can get and
set 'PRAGMA locking_mode' and 'PRAGMA synchronize'. <br>
Thank you. Regards -- Joe<br>
<br>
<br>
<br>
</body>
</html>