Galin Iliev's blog

Software Architecture & Development

Connection pooling and application domains

Yesterday I wrote about my Connection pooling tests and I had good comment from Marto Kulov about application domains.

It was easy so I wrote the following code to create new application domain and execute two forms from different assemblies in order to test if they share same connection pool


   1:  AppDomain domain = AppDomain.CreateDomain("myNewDomain");
   3:  Form frm1 = domain.CreateInstanceFromAndUnwrap("WindowsApplication1.exe", "WindowsApplication1.Form1") as Form;
   4:  Form frm2 = domain.CreateInstanceFromAndUnwrap("WindowsApplication2.exe", "WindowsApplication2.Form1") as Form;
   6:  frm1.Show();
   7:  frm2.Show();

And the answer is Yes, They share same connection pool. Both forms executed same for loop and opened 10 connections each to the MS SQL Server. And on the SQL Server side was only one connection alive.

So this is the way to share a connection pool between two processes - put them in one process and in one application domain.



Comments (1) -

  • Daniel

    4/23/2007 8:35:11 AM | Reply

    I saw on microsoft's forums that you managed to use latitude and longitude in mdx queries;
    please can you give some hints or samples of your queries ?