<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><span class="tlid-translation translation" lang="en">hello and
good day<br>
<br>
I use sqlite3 and get the following error: Query failed: can not
start a transaction within a transaction<br>
The error occurs when I use sqlite Transaction. For example:<br>
begin transaction; create table bla bla bla; commit;<br>
For example, if I had already created this table once and
overlooked it, I get an error. Absolutely normal.<br>
If I repeat the statement with a new table name, I get the error
above: Query failed: can not start a transaction within a
transaction<br>
I researched but did not really find anything.<br>
For the test, I ended the connection to the database and
restarted. No more problems.<br>
I then noticed that sqlite does not seem to stop the transaction
when the error occurs, ignoring the "commit" and keeping the
transaction open.<br>
Or in general: If an error occurs in a statement of a
transaction, the transaction is not terminated. It is stopped
before the commit and the transaction remains open.<br>
If I execute a hconn.execute ("commit;") after the failed
creation of the table, every further transaction is possible.<br>
So far I would have solved that. But somehow unsatisfactory and
not elegant.<br>
Now my question:<br>
Is there a way in sqlite to catch an error (such as the one
described) and then automatically stop the transaction?<br>
<br>
Peter</span></p>
</body>
</html>