ASP静态数据库连接

时间:2015-05-13 10:02:59

标签: c# asp.net thread-safety database-connection

我在Connection类中有以下代码

private static SqlConnection m_con
    {
        get
        {
            var maxPriv = GetMaximumPrivelegeLvl();
            if (maxPriv > m_currentPrivelegeLvl)
            {
                m_instance = new Connection(maxPriv);
            }
            return m_instance.m_databaseConnection;
        }
    }


    private readonly SqlConnection m_databaseConnection;

这是线程安全吗?

0 个答案:

没有答案