enterprise-librarydaab

Enterprise Library 5.0 - DatabaseFactory.CreateDatabase() - Slow performance


Im using Enterprise Library 5.0 Data Access block. the Creation of a databaseinstance is really slow. DatabaseFactory.CreateDatabase() statement consumes a lot of time when connecting to SQL Server

  1. What are the best practices for high performance Enterprise library DAAB DB creation
  2. Can I Create a object pooling mechanism and reuse the Objects rather than creating it again and again. Will this create any concurrency problems?

Solution

  • DatabaseFactory.CreateDatabase doesn't connect to the database server at all; if it's slow, something else is going on. The only external thing it should be hitting is the configuration file, and that should only happen on the first request.

    Where is your configuration (disk? network share? database? other?)?

    Also - how do you define "really slow"? Can you post a sample that demonstrates the problem?