views:

69

answers:

0

I need to know the best way to do the following. I have nested business level APIs (say level 1 & level 2). L1 needs to call L2. Both APIs use the database layer directly at their own nesting levels.

Now, in the database layer, I fetch the db connection from the pool each time as follows:

    SqlConnection conn = new SqlConnection(connString);
    conn.Open();
  1. Is it proper to fetch the db connection each time on every DB level call as above? I know it will return a connection from the ASP.NET connection pool.

  2. However, wouldn't it be better to maintain the same DB connection throughout the nested calls (or throughout the current http request lifetime)?

  3. Will fetching a connection from the pool each time cause issues with nested TransactionScopes?