Exemplo n.º 1
0
        public static void InitializeSqlMapper()
        {
            if (_sqlmapper == null)
            {
                lock (typeof(IBatisNet.DataMapper.SqlMapper))
                {
                    //if (_sqlmapper == null) // double-check
                    //{
                    IBatisNet.Common.Utilities.ConfigureHandler         handler = new IBatisNet.Common.Utilities.ConfigureHandler(Configure);
                    IBatisNet.DataMapper.Configuration.DomSqlMapBuilder builder = new IBatisNet.DataMapper.Configuration.DomSqlMapBuilder();
#if DEBUG
                    try
                    {
                        _sqlmapper = builder.ConfigureAndWatch("Book.SQLServer.SQLMap.config", handler);
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
#else
                    _sqlmapper = builder.ConfigureAndWatch("Book.SQLServer.SQLMap.config", handler);
#endif

                    //   }
                }
            }
        }