Login Skip Navigation LinksWilsonORMapper > Forums Search
Demo Version Demo Version
Download and try for yourself a fully working demo version, including sample apps and documentation.  The only limitation is that the demo version only works inside the debugger.

PayPal Subscribe
Get It All for $50 USD:
WebPortal, ORMapper,
Source Code, All Updates
PayPal

User Login User Login
Log In
 
 
Reset Password

Wilson ORMapper Forums Wilson ORMapper Forums : Advanced Topics : capturing the begin and end time of sql statements generated by the ormapper

Date Post
6/13/2006 8:31:14 PM

Hi Paul,

Can you please tell how i can accomplish capturing the time it took for a sql statement to execute in orampper. I tried looking into IIintercept but it does not have methods like begin sql execution and end sql executioin where i can actually start recording the time and then end recording in the end event and then write that to a log table. I really dont want to be using a profiler cuz i want to accomplish a permanant solution where i can run sql statements in the database on that table to accomplish better optimization techniques. can u please tell what options do i have or how would acheive it in ormapper. i would like to use log4net to record it to the database. i would be nice if you have any example in that area.

 

Thanks

6/13/2006 8:41:54 PM There is really no easier way than using the sql profiler, and possibly some performance counters that you could setup.  The IInterceptCommand exposes the DbCommand object immediately BEFORE its sent to the database so that you can modify it if desired, so its not really designed to measure a time-difference.  You may be able to achieve that functionality by modifying the code, and it may not even be drastically hard since the calls in question are pretty much all in Connection, but even then its not trivial since DataReaders won't actually be contained to just that one class.  So while its doable, it will be work, and keep in mind that there are existing performance tools that are no doubt going to help you achieve your goals better even if its not your current strategy.

Thanks, Paul Wilson