You are not logged in.
Hi AB,
in line 1337 of unit in subject there are these istructions .
except
on E: ESQLite3Exception do
GetAndPrepareStatementRelease(E);
end;
createandfillprepare , in case of exception, returns a null resultset without any advertisement.
This means that i have , every time , to check for tSqlRsetServerDB.StatementLastException to be sure that all worked fine ?
Now i'm only catching exceptions.
Offline
By design, exceptions can't be propagated over a network.
Since all this DB process may be run remotely, the exceptions are catch on server side.
So yes, you have to check for a null result set, as documented.
A valid request, returning no result row, will never be null - but only with column names.
Offline
Tx AB.
Offline
Anhoter question please :
on server side , what object, instead of tMySQLRestServerDB, I should better use to access data by ORM?
Offline
Well,
one thing i have clear , i am totally confused and thick as a brick !!
Sorry to annoying you with newby questions, but i'm trying to put order in my mind :
- a tSQLRestServerDb runs only on server side.
- I'm using a tSQLClientRestURI to run processes from remote.
- so , why a tSQLRestServerDB.CreateAndFillPrepare doesn't return an exception ?
Offline
Because ORM methods do implement the Liskov substitution principle, so they follow abstract TSQLRest expectations, which may be a client or server implementation.
If the server does not behave the same as the client (i.e. raise an exception whereas the client won't), then the Liskov principle is broken.
Offline
Sounds a very good reason.
I have added a control of StatementLastException after the createandfillprepare nested in transaction : now seems to work ok.
tx very much AB.
Offline