Commit TUniTransaction before closing TUniTable

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
testpresta
Posts: 32
Joined: Sat 07 Jun 2014 19:41

Commit TUniTransaction before closing TUniTable

Post by testpresta » Fri 29 Aug 2014 15:35

Hello

I have several TUniTable components which property transaction is set to an unique TUniTransaction.

I start transaction before opening any table.
Then, i close some tables before commit transaction and i close other tables after commit transaction.
(same thing for rollback).

Does it works properly this way ?

Thanks

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Commit TUniTransaction before closing TUniTable

Post by azyk » Tue 02 Sep 2014 13:03

We don't fully understand the point of your question. If you have encountered a problem in a particular case, please describe it in more details.

testpresta
Posts: 32
Joined: Sat 07 Jun 2014 19:41

Re: Commit TUniTransaction before closing TUniTable

Post by testpresta » Wed 03 Sep 2014 07:02

Everything works but i want to know what is the best practice:

- I open TUniTable
- I start a TUniTransaction that is associate to the previous TUniTable
- I append or edit TUniTable then post
- I close the TUniTable component (close method)
- I commit transaction

or

- I open TUniTable
- I start a TUniTransaction that is associate to the previous TUniTable
- I append or edit TUniTable then post
- I commit transaction
- I close the TUniTable component (close method)

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Commit TUniTransaction before closing TUniTable

Post by azyk » Tue 09 Sep 2014 10:37

We can not give a definite answer to such a general question. You should choose a transaction control logic depending on the business logic of your application and the used DBMS.

Post Reply