11:51That is the *only* viable solution. There are means to check if a connection is alive with
>> select query connection "connection-dead" ;== false
and without a connection succesfully opened you wouldn't be able to open a statement.
But of course in the timespan between evaluation of this
query expression and the consecutive
insert expression anything might happen: Somewhere whole new universes might be born eventually. And here, the connection might get lost in between due to networking problems and such.
The only way to know if executing a statement has failed is testing if executing has thrown an error or not. The future is predictable only in hindsight.