Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.
|Page Name:||about Pause()|
IntroductionMany power users routinely use SpatiaLite for executing very complex SQL Scripts, may be largely based on Stored Procedures.
Sometimes attempting to debug a complex SQL script may easily become a difficult and frustrating activity.
In order to facilitate the debugging of SQL Scripts as much as possible, SpatiaLite (starting since version 5.0.0) supports a specific Pause() SQL function.
This function is intented to be the conceptual equivalent of what a breakpoint is intended to be for ordinary debugger tools.
Few basic concepts:
- you, as the developer of the SQL Script, are free to call Pause() at some critical point of the Script (where you suspect that nasty things have just happened).
- once Pause() is executed it suddenly stops any further execution of the calling process, that will indefinitely remain in a frozen state.
- this gives you the opportunity to start a second hinstance of SpatiaLite to be used for inspecting any possible detail in the work database,
And you'll be eventually free to correct on the fly some wrong value you'll notice somewhere.
- when you've completed all your debug activities, you simply have to take the appropriate continue action,
The SQL Script will then resume its normal execution exactly from the statement immediately following Pause()
- Note: nothing forbids to call Pause() as many times as you can find useful from within the same SQL Script.
Important notice: Pause() and TransactionsRecall: all changes contained within a pending (aka uncommitted SQL Transaction are strictly private.
This practically means that all them will remain completely invisibile to any other connection accessing the same database.
But a debugging session as previously defined necessarily requires using at least two different connections
(the one suspended by Pause() and the other used for inspecting the database).
Short conclusion: the only safe way for calling Pause() is