If you are talking about speed optimization for the script, it matters not whether you place the web_reg_find within the transaction block.
In theory, there should be a difference in the transaction timings returned by either method, but we're only talking here about the time it takes to execute a line of code in the script.
The fact of the matter is that the script sends a request to the server and then spends a heck of a lot of time waiting for the server to respond, and not a heck of a lot of time zipping through the subsequent non-action steps.
My personal 'best-practice', for what it's worth, is to insert the web_reg_find statement prior to the lr_start_transaction. Reason being that I don't then get annoying lr_think_time statements embedded within the transaction. It doesn't impact end-result, but does make the code moderately more obfuscated. [img]images/icons/smile.gif[/img]
Whether you place the web_reg_find() inside or outside of the transaction, the activity associated with the execution of that statement will occur on the next set of returned data. in theory, the impact should be minimal, not perceptable on a human scale. If you're concerned with the code impact, you could always use lr_stop_transaction() prior to the execution of any conditional code associated with the setting of the end status of the transaction based upon the results of the number of instances associated with the web_reg_find().
The overhead associated with these service functions is generally very very low, considering that they act as a sieve through which a returned datastream is passed. If successful, then the sieve has contents after the call. If unsuccessful, the sieve is empty.
[ 09-26-2005, 08:46 PM: Message edited by: James Pulley ]
My coworkers and I had an interesting debate during a script walk through, and I got the lovely task of trying to query to find out what the best practices are for web_reg_finds and to identify whether or not those should be contained within a transaction or outside of a transaction block for speed optimization.
It is my theory that this is not a big time consumer, but other people have seen performance impacts in the past.
within transaction block:
1 start tran
2 web reg find
3 get url
4 end tran
outside transaction block:
1. web reg find
2. start tran
3. get url
4. end tran
Thanks for your help, i will try and start a poll on this as well