Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: How do i use transaction?
How do i use transaction?
Posted: 2007/05/21 15:16
 
I'm newbie of thindac.

I can't find any method related to transaction.

How can i use the transaction?
Re:How do i use transaction?
Posted: 2007/05/21 17:44
 
Hello

1) Currently ThinDAC servers are stateless. So, you cannot start transaction from client, execute commands from client and then finish transaction. As result, there is no explicit transaction control methods at client side.

2) When you call TTDClientDataSet.ApplyUpdates, then all cached updates will be posted to DB in single transaction.

3) You always can develop own remote function, using RTC SDK. And in this function, perform multiple commands with explicit transaction control. Then just call this function from your client application.

Regards,
Dmitry
Re:How do i use transaction?
Posted: 2007/05/21 18:40
 
If i want to update more than 1 dataset under transaction, I can not use transaction.

Yes. I can use messages. But to do this, i have to implement from scratch.

1. Save changes to stream. Or save sqls with params to stream from multiple datasets.
2. send it to server
3. In server, i have to create db connection and parse stream to sql and params.
4. Run sqls under transaction.
5. Return results.

Is there any helpful functions or methods in thindac to implement above?

Post edited by: skman, at: 2007/05/21 18:41
Re:How do i use transaction?
Posted: 2007/05/21 19:31
 
Hello

Right now there is no simple way to implement what you need. I will suggest to wait v 2.0. There will be implement statefull server mode, so explicit transaction control from client will be possible.

Regards,
Dmitry