Best place to start a transaction

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

Best place to start a transaction

Post by testpresta » Wed 06 Aug 2014 04:14

Hello

Suppose i have a sort of order screens:

- a screen with order list
- an order detail screen with an ok button.

actually, i start a transaction when the user clicks on the ok button of the detail screen (just before SQL queries).
I am wondering if it is a good thing. Is it a good way ? Should the transaction be started when the user just access to detail screen ?

Thanks

CristianP
Posts: 79
Joined: Fri 07 Dec 2012 07:44
Location: Timișoara, Romania

Re: Best place to start a transaction

Post by CristianP » Wed 06 Aug 2014 12:14

The best practice is to keep the transaction time as short as possible.
Especially for a high transaction isolation level and many concurrent queries on same data.
Here is a summary:
http://en.wikipedia.org/wiki/Isolation_ ... k_Duration

Best regards,
Cristian Peta

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

Re: Best place to start a transaction

Post by azyk » Wed 06 Aug 2014 12:45

This question is not related to UniDAC functionality. Your question about using transactions in your case taking into account all the requirements to your product should be forwarded to the documentation and developers of the database you are using.

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

Re: Best place to start a transaction

Post by testpresta » Wed 06 Aug 2014 14:16

I am sorry. In fact i was wondering if there was some specific cases to TUniTransaction component, not only database engine

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

Re: Best place to start a transaction

Post by azyk » Fri 08 Aug 2014 12:42

For more details on using UniDAC transactions, refer to our online documentation: http://www.devart.com/unidac/docs/index ... action.htm
Feel free to contact us, if your still have questions after reading the documentation.

Post Reply