Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Recommended approach for complex DB actions

$
0
0
What is the recommended approach for executing DB actions that include more than one fetch/update/remove operations?

As an example, I want to add a record to a table. But, in order for that, I have to fetch another tables for getting the necessary ids, remove records from another tables, etc.

Until now, I did that in a client-based manner, using callbacks when the individual operations were executed. So the "big" operation was done sending small fetch/update/insert operations to the server.
But this was sometimes complicated, so I started investigating how to move that to a server-based manner.

I defined a custom operation:
Code:

<operationBinding operationType="custom"
                        operationId="addBigRecord">
                        <serverObject
                                className="server.dmi.OperationDMIHandler"
                                methodName="addBigRecord" />
                </operationBinding>

which is the "big" operation. There, in "addBigRecord", I do all necessary steps for achieving this (using server-based DSRequests). I like this approach, since I don't have to send data to the client until the big operation is completed.
Is this a recommended approach or would you rather recommend the client-based approach?

Using smartgwt 4.1 power.

Viewing all articles
Browse latest Browse all 4756

Trending Articles