Wiki page
[about Pause()] by
sandro
2019-05-29 20:14:35.
D 2019-05-29T20:14:35.682
L about\sPause()
U sandro
W 2556
<a href="https://www.gaia-gis.it/fossil/libspatialite/wiki?name=4.3.0-doc">back</a><hr><br>
<h1>Introduction</h1>
Many power users routinely use SpatiaLite for executing <b>very complex SQL Scripts</b>, may be largely based on <b>Stored Procedures</b>.<br>
Sometimes attempting to debug a complex SQL script may easily become a difficult and frustrating activity.<br><br>
In order to facilitate the debugging of SQL Scripts as much as possible, SpatiaLite (starting since <b>version 5.0.0</b>) supports a specific <b>Pause()</b> SQL function.<br>
This function is intented to be the conceptual equivalent of what a <a href="https://en.wikipedia.org/wiki/Breakpoint">breakpoint</a> is intended to be for ordinary debugger tools.<br><br>
Few basic concepts:
<ul>
<li>you, as the developer of the SQL Script, are free to call <b>Pause()</b> at some critical point of the Script (<i>where you suspect that nasty things have just happened</i>).</li>
<li>once <b>Pause()</b> is executed it suddenly stops any further execution of the calling process, that will indefinitely remain in a frozen state.</li>
<li>this gives you the opportunity to start a second hinstance of SpatiaLite to be used for inspecting any possible detail in the work database,<br>
And you'll be eventually free to correct on the fly some wrong value you'll notice somewhere.</li>
<li>when you've completed all your debug activities, you simply have to take the appropriate <b>continue action</b>,<br>
The SQL Script will then resume its normal execution exactly from the statement immediately following <b>Pause()</b></li>
<li><b><u>Note</u></b>: nothing forbids to call <b>Pause()</b> as many times as you can find useful from within the same SQL Script.</li>
</ul>
<br>
<table cellpadding="6" cellspacing="6" bgcolor="#ffffd0">
<tr><td>
<h3>Important notice: Pause() and Transactions</h3>
<b><u>Recall</u></b>: all changes contained within a <b>pending</b> (<i>aka</i> <b>uncommitted</b> SQL Transaction are strictly private.<br>
This practically means that all them will remain completely invisibile to any other connection accessing the same database.<br>
But a debugging session as previously defined necessarily requires using at least two different connections<br>
(<i>the one suspended by <b>Pause()</b> and the other used for inspecting the database).<br><br>
<b><i>Short conclusion</i></b>: the only safe way for calling <b>Pause()</b> is
</td><tr>
</table>
<hr><br>
<a href="https://www.gaia-gis.it/fossil/libspatialite/wiki?name=4.3.0-doc">back</a>
Z 717ff5a05c18766badee535d36fc7ee8