Home » U++ Library support » U++ SQL » questions about sqlArray
Re: questions about sqlArray [message #35401 is a reply to message #35396] |
Fri, 10 February 2012 11:47   |
 |
mirek
Messages: 14265 Registered: November 2005
|
Ultimate Member |
|
|
papascalientes wrote on Thu, 09 February 2012 04:24 |
1. How can I detect if the sqlArray encountered an error so that the application can react according to the errror?
Reason:
If there was an sql error, I get an error message and after that the application crashes sometimes. As far as I understand it, there is an ClearError() in UPP after showing the error message so that I can't use WasError() after a query. My idea was to use WhenPostQuery because it seems not be invoked if there was an error. Is that a good idea or is there a better way?
And what about editing, appending, deleting in the sqlArray? How can I detect an error there?
|
SqlArray is 'high-level' widget that is supposed to manage all errors and transactions on its own.
So I would rather concentrated on why the app is crashing after error message - the most likely cause is that it expects some data to be somewhere where there are none (e.g. after emoty query).
That said, I am not really opposed to adding some finer control about these issues, perhaps by adding Callbacks to perform alternate transaction management and error reporting. Just nobody really needed this so far...
Quote: |
2. Is there a way to use an exclusive transaction for the sqlArray? Like I can use BEGIN EXCLUSIVE to start an exlusive transaction when using sql commands without sqlArray?
Reason:
In very rare cases it might happen that two applications try to write to the same database at the same time.
|
But two application writing to same rows of single database, that is pretty much normal and that is what normal transactions are supposed to solve. No need and not really any advantage in most cases to lock the whole DB...
All that said, I would like to repeat that SqlArray is high-level thing, which imposes some restrictions.
Generally, I have to say that over years, I am gradually using it less and less and mostly for configuration dialogs (where normal users of my apps usually do not really visit) or only using it for queries, not doing any actual inserts/updates/deletes (which I then implement in my own code) - pretty standard approach for me now is to use dialogs for row content, with great help of SqlCtrls to manage inserts/updates.
Mirek
|
|
|
Goto Forum:
Current Time: Fri Jul 04 08:33:49 CEST 2025
Total time taken to generate the page: 0.04825 seconds
|