Caching parameterinfo necessary?

Topics: Data Access Application Block
Dec 28, 2006 at 9:23 PM

When you use stored procedures with entlib and you want to have the framework to discover the parameterinfo (discovery), then these parameters are cached. This is normal since the first time a roundtrip to the db is done to discover this information and we don't want this anymore the next time.

However when you provide all parameterinfo, there is no caching done for you.
Would it be better if I then also cache these myself? Or would this provide no benefits (performance-wise).

If this would be wise, is there a way to use the internal parametercache or would I then just use the caching appblock?

Best regards,
Jan 13, 2007 at 4:16 PM
It isn't necessary. As you mentioned, the only reason it is done in parameter discovery is to avoid additional round trips to the database for already discovered parameters.

If you provide the parameters you don't have that performance hit and thus no need for the caching.




David Hayden
Microsoft MVP C#