Subject | Re: When do I commit |
---|---|
Author | Adam |
Post date | 2005-06-07T02:01:23Z |
--- In firebird-support@yahoogroups.com, Grant Brown <grant@s...>
wrote:
happen inside the single transaction.
kept in memory, so each search is at worst n complexity. Certainly,
the first time someone adds a new parameter to your query and you
have to figure out why your program stops working you will appreciate
having the FieldByName. Certainly, having the prepare inside the for
loop well and truly stuffs up any performance gain you had there.
Adam
wrote:
> Hi Adam,18
>
> >> do you really want ALL of the inserts to be rolled back?
>
> Yes - What I need is an all or nothing. The for loop should process
> times and I need all 18 loops to be without error or they all needto be
> rolled back.In that case your statement is correct, you want all the inserts to
happen inside the single transaction.
>cause
> Question :- doest "ParamByName" (and FieldByname for that matter)
> the query to search its parameters list each time its called andthen
> returns the index value. Params[0] prevents the search and hencespeeds
> up the query ?I doubt it is noticable. They tend to be very small lists and are
kept in memory, so each search is at worst n complexity. Certainly,
the first time someone adds a new parameter to your query and you
have to figure out why your program stops working you will appreciate
having the FieldByName. Certainly, having the prepare inside the for
loop well and truly stuffs up any performance gain you had there.
>Yep I'm nuts :(
> >> Also, unless I am going nuts, you probably want to stop at
> High(PerArray)-1
>
> PerArray is a zero based array so High(MyArray) will return
> Length(MyArray) - 1
>
Adam