I suppose you would have to use your approch of time recording in that case.... about the latency factor, we cannot exactly say that the latency would remain uniform for every query fired from application.... since, the latency could be depend on the current
n/w load etc.
moreover, connection pool would play a role in how quicker you get the response in App... as in case of using pooled connections, you might save some time in comparison with the instances where new connection need to be initialised...
even after given all these things.... if the execution time of your queries is significant (more) then all other delay factors caused by application would not affect result much... and you could reasonably use time recording approch
hope this helps...
Cheers!
KK
Please mark as Answer if post helps in resolving your issue
My Site
Marked as answer by Dr. Acula on Feb 02, 2012 03:10 PM
kedarrkulkar...
All-Star
34545 Points
5554 Posts
Re: get the time it took for a command to execute?
Feb 02, 2012 02:39 PM|LINK
hummmm...
actually there is SqlConnection.RetrieveStatistics Method available for SqlConnection which does this job...
but of course...... since you are using oracle database.... you cannot simply use it...
however, you might want to take a look at how it works...
http://dbtutorials.com/advanced/dac-execution-time-cs.aspx
http://codebetter.com/davidhayden/2005/11/02/sqlconnection-retrievestatistics-in-net-2-0/
I havent tried this for Oracle... but looking at OracleConenction class, it seems simillar method is missing
http://msdn.microsoft.com/en-us/library/system.data.oracleclient.oracleconnection.aspx
I suppose you would have to use your approch of time recording in that case.... about the latency factor, we cannot exactly say that the latency would remain uniform for every query fired from application.... since, the latency could be depend on the current n/w load etc.
moreover, connection pool would play a role in how quicker you get the response in App... as in case of using pooled connections, you might save some time in comparison with the instances where new connection need to be initialised...
even after given all these things.... if the execution time of your queries is significant (more) then all other delay factors caused by application would not affect result much... and you could reasonably use time recording approch
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site