Better Place To Starting Transaction
Posted: Mon 05 Apr 2010 02:12
hello...
I try to develop a small application with unidac, just for practice n experience. I make a data form with 5 button. in INSERT button on click I just write :
and in POST on click I write :
my friend said that this procedure is bad because I start the transaction after INSERT command (in SAVE button). But if I call StartTransaction before INSERT command (on INSERT button), it's could be user take too long before post the data. Which one is the better option in Unidac, and please give some explanation. Or if there is another better way, please teach me (but still use DataControl component).
Thank's very much for all your attention
I try to develop a small application with unidac, just for practice n experience. I make a data form with 5 button. in INSERT button on click I just write :
Code: Select all
UniTableMast.Insert;Code: Select all
try
If not UniTrans1.InTransaction then
Unitrans1.StartTransaction;
UniTableMast.Post;
UniTableDet.Insert;
UniTableDet.Post;
If UniTrans1.InTransaction then
Unitrans1.Commit;
except
If UniTrans1.InTransaction then
Unitrans1.Rollback;
end;Thank's very much for all your attention