Using mulitple TDAMemDataTables on server within same connection

delphi

(kasteren) #1

Hi,

I’m using commands, MemDataTables to update data in one service.I need all of them to use the same connection (to use 1 transaction). I used to do this with the localConnection property in the MemDatatable but this property is gone.
How can I force a MemDatatable (or the LocalDataAdapter) to use a specific connection?
Everything is Server-side in one service.

Thanks

Mies


(EvgenyK) #2

Hi,

you can specify

LocalDataAdapter.ServiceInstance := xxxx;

in this case, it will use specific service instance where you can specify required connection .

also you can specify aUseDefaultTransactionLogic:=False in OnUpdateDataBeginTransaction, OnUpdateDataCommitTransaction, OnUpdateDataRollBackTransaction events of DAService for avoiding default transaction logic when you update data via LDA.


(kasteren) #3

Yes, that did the trick.

All commands and MemDatatables use the same connection and transaction.

Thanks for the quick reply.