This project is read-only.

Async DatabaseFactory??

Feb 6, 2013 at 7:07 PM
Does anyone know the difference in these two database factories? What does Async do?
          <type type="IDatabaseFactory" mapTo="DatabaseFactory">
            <lifetime type="PerWebRequest"/>
            <typeConfig extensionType="Microsoft.Practices.Unity.Configuration.TypeInjectionElement, Microsoft.Practices.Unity.Configuration">
              <constructor>
                <param name="connectionString" parameterType="ConnectionString">
                  <dependency/>
                </param>
              </constructor>
            </typeConfig>
          </type>
          <type name="Async" type="IDatabaseFactory" mapTo="DatabaseFactory">
            <lifetime type="Singleton"/>
            <typeConfig extensionType="Microsoft.Practices.Unity.Configuration.TypeInjectionElement, Microsoft.Practices.Unity.Configuration">
              <constructor>
                <param name="connectionString" parameterType="ConnectionString">
                  <dependency/>
                </param>
              </constructor>
            </typeConfig>
          </type>
Oct 6, 2013 at 2:33 AM
Edited Oct 6, 2013 at 2:34 AM
If the calling class is from a web request it uses a new database connection and disposes it right after. For everything else, it uses a shared singleton database object.

I think.