Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread V3 ISAPI Commit
Fri, Nov 26 2021 6:22 PMPermanent Link

Eivind

Gents

I have asked in previous threads about the usage of EWBDatabaseAdapter & EWBDataSetAdapter and was informed that some new versions of the DataSetAdapter now had support for TParams like the GetRowsJSON(). This works perfectly in my ISAPI dll and serves data to the EWB App.

As I have been back to some V2 projects lately I'm now back again and trying to figure out how to commit data in my ISAPI dll using V3. in V2 I simply did call EWBDatabaseAdapter.Commit(PostedData). How does that work now? I see there are a EWBDatabaseAdapter.HandleRequest procedure but that only accepts TEWBServerRequest and not the request that comes in on the ISAPI declared function I have called /commit. Does HandleRequest has to be called in ISAPI? The CommitTransaction function does not take any payload like before with the posted JSON data. How can I apply the payload sendt to the ISAPI to the V3 EWBDatabaseAdapter?

Thanks,
Eivind
Mon, Nov 29 2021 6:24 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Eivind,

<< I have asked in previous threads about the usage of EWBDatabaseAdapter & EWBDataSetAdapter and was informed that some new versions of the DataSetAdapter now had support for TParams like the GetRowsJSON(). This works perfectly in my ISAPI dll and serves data to the EWB App.

As I have been back to some V2 projects lately I'm now back again and trying to figure out how to commit data in my ISAPI dll using V3. in V2 I simply did call EWBDatabaseAdapter.Commit(PostedData). How does that work now? I see there are a EWBDatabaseAdapter.HandleRequest procedure but that only accepts TEWBServerRequest and not the request that comes in on the ISAPI declared function I have called /commit. Does HandleRequest has to be called in ISAPI? The CommitTransaction function does not take any payload like before with the posted JSON data. How can I apply the payload sendt to the ISAPI to the V3 EWBDatabaseAdapter? >>

Reply from email:

What you want is this method:

https://www.elevatesoft.com/manual?action=viewmethod&id=ewb3mod&product=rsdelphiwin32&version=11&comp=TEWBDatabaseAdapter&method=CommitTransaction

The OnGetDataSetAdapter event will then get called where you can return an instance of the data adapter that you wish to use for the commit.

In the dataset adapter, you can then define event handlers for these events in order to handle tell the EWB code which parameters need populating:

https://www.elevatesoft.com/manual?action=viewevent&id=ewb3mod&product=rsdelphiwin32&version=11&comp=TEWBDataSetAdapter&event=OnGetInsertParams
https://www.elevatesoft.com/manual?action=viewevent&id=ewb3mod&product=rsdelphiwin32&version=11&comp=TEWBDataSetAdapter&event=OnGetUpdateParams
https://www.elevatesoft.com/manual?action=viewevent&id=ewb3mod&product=rsdelphiwin32&version=11&comp=TEWBDataSetAdapter&event=OnGetDeleteParams

And then define event handlers for these events in order to execute the actual insert, update, or delete commands:

https://www.elevatesoft.com/manual?action=viewevent&id=ewb3mod&product=rsdelphiwin32&version=11&comp=TEWBDataSetAdapter&event=OnExecuteInsert
https://www.elevatesoft.com/manual?action=viewevent&id=ewb3mod&product=rsdelphiwin32&version=11&comp=TEWBDataSetAdapter&event=OnExecuteUpdate
https://www.elevatesoft.com/manual?action=viewevent&id=ewb3mod&product=rsdelphiwin32&version=11&comp=TEWBDataSetAdapter&event=OnExecuteDelete

It seems like a lot of work, but if you use a database that can return TParams instance for parameterized SQL statements, then you only need to set up your parameterized SQL statements in the desired fashion, and then return the TParams instance from each.

Tim Young
Elevate Software
www.elevatesoft.com
Image