How do you catch this exception and handle it in your own code?

Here is a typical call sequence between idCustomHTTPServer and TDataAbstractService.InternalGetData:

DataAbstractService_Impl.TDataAbstractService.InternalGetData($3D5B3F0,$3D5B8A0,$2EB1900)
DataAbstractService_Impl.TDataAbstractService.GetData($3D5B3F0,$3D5B8A0)
DataAbstract4_Invk.TDataAbstractService_Invoker.Invoke_GetData(TDataService($2E8560C) as IInterface,TROBinMessage($2E93C30) as IROMessage,TIndyHTTPTransport($2F5384C) as IROTransport,[])
uROServer.TROInvoker.CustomHandleMessage(TROClassFactory($2F50A94) as IROClassFactory,TROBinMessage($2E93C30) as IROMessage,TIndyHTTPTransport($2F5384C) as IROTransport,[])
uROServer.TROInvoker.HandleMessage(TROClassFactory($2F50A94) as IROClassFactory,TROBinMessage($2E93C30) as IROMessage,TIndyHTTPTransport($2F5384C) as IROTransport,[])
uROServer.MainProcessMessage(TROBinMessage($2E93C30) as IROMessage,TIndyHTTPTransport($2F5384C) as IROTransport,$2E8E3F0,$2E8E6F0,[],True)
uROServer.TROMessageDispatcher.ProcessMessage(TIndyHTTPTransport($2F5384C) as IROTransport,$2E8E3F0,$2E8E6F0,[],True)
uROServer.TROServer.IntDispatchMessage($2F50B90,TIndyHTTPTransport($2F5384C) as IROTransport,$2E8E3F0,$2E8E6F0,[])
uROBaseHTTPServer.TROBaseHTTPServer.ProcessRequest(TIndyHTTPTransport($2F5384C) as IROHTTPTransportEx,$2E8E3F0,$2E8E6F0,TIPHTTPResponseHeaders($3D5B250) as IROHTTPResponse)
uROIndyHTTPServer.TROIndyHTTPServer.InternalServerCommandGet($2F828B0,$2EDC0A0,$2ED5650)
IdCustomHTTPServer.TIdCustomHTTPServer.DoCommandGet($2F828B0,$2EDC0A0,$2ED5650)
IdCustomHTTPServer.TIdCustomHTTPServer.DoExecute($2F828B0)
IdContext.TIdContext.Run

When the code dies, it blows up with an SQL error here:

Project myapp.exe raised exception class Exception with message ‘Invalid column name ‘column’.’.

This is something I find very frustrating and difficult to debug. What is dying? Who knows!? Does
my DataService_Impl.pas data abstract data module even have an OnError method? No it does not.
It has really handy events like OnDeactivate, whatever THAT is, but not an error handler?

It seems that there is an OnError message inside TDataAbstractService.InternalGetData but how does
that surface to me in my Delphi server code?

Here’s the call stack between InternalGetData and the point where an exception is raised when there’s an SQL problem:

:00665443 TCustomADODataSet.OpenCursor + $B7
:0040cb4e @CheckAutoResult + $22
:00665443 TCustomADODataSet.OpenCursor + $B7
:0058d5e3 TDataSet.SetActive + $5B
uDAEngine.TDANativeDatabaseAccess_Dataset.SetActive(True)
uDAEngine.TDAEDataset.DoSetActive(True)
uDAEngine.TDAEDataset.SetActive(True)
uDAEngine.TDAEDataset.Open
DataAbstractService_Impl.TDataAbstractService.InternalGetData($3D5B6C0,$3D5B850,$2EB1900)

How that gets back to my user application, I still haven’t figured out.

And why the SQL, which WORKS JUST FINE when I run the SQL outside data-abstract blows up with inability to find a column which definitely exists in the fields list (I can see it in the debugger just fine).

self.ffields[9] = ‘column’ (the column I want is definitely there in the ffields property of the TDAEADOQuery and yet it
is blowing up on a “column not found” error.

It must be some crazy “mapping thing”.

Hello,
Sorry for delay.
Can you send us a small testcase which reproduces it? We will fix it.

I seem to be stuck here again.

I figured this out. There was a query returning multiple resultsets that I had to suppress.