I have been working on some testing code, ramping up on LLBLGen. I use the adapter templates. I am using the 2005 beta extended entity templates.
I am noticing that the first time the DataAccessAdapter is instantiated, there is a 1 to 2 second wait, but even if it is disposed in a using statement, the next time it is called is very quick as long as the test application has continued running. As soon as I stop the test app and re-run it, there is that delay on the first call.
The code that I am observing this in looks like and the delay is on the bolded line:
EntityCollection content = new EntityCollection(new MyContentEntityFactory());
try
{
**using( DataAccessAdapter odapt = new DataAccessAdapter())**
{
IRelationPredicateBucket bucket = new RelationPredicateBucket();
odapt.FetchEntityCollection(content,bucket);
return content;
}
}
I thought maybe that it is the result of the database connection being created on the first call but connection caching for later calls resulting is the quick latter access times. I created an SQLConnection to the same SQL Server 2000 database through code and it was almost instantaneous, the first time I call it.
For Windows Apps, I can see the ability to cache or keep the dataaccessadapter object aound and re-used throughout a form, or use case.
But what about web apps? Are people using LLBLGen for web apps where each request is going to create and tear down the DataAccessAdapter object? Does it always incur this 1-2 second delay or will it only be slow for the 1st access by the IIS worker thread process, but all subsequent requests will be quick? Is this an aberration of my environment.?
Hoping someone might be able to shed some light on this observation.
Thanks.
Can1