Spring.Data.NHibernate.SessionFactoryUtils.NewAdoExceptionTranslator C# (CSharp) Method

NewAdoExceptionTranslator() public static method

Create a IAdoExceptionTranslator from the given SessionFactory.
If a corresponding IDbProvider is found, a ErrorcodeExceptionTranslator for the IDbProvider is created. Otherwise, a FallbackException is created.
public static NewAdoExceptionTranslator ( ISessionFactory sessionFactory ) : IAdoExceptionTranslator
sessionFactory ISessionFactory The session factory to create the translator for
return IAdoExceptionTranslator
	    public static IAdoExceptionTranslator NewAdoExceptionTranslator(ISessionFactory sessionFactory)
	    {
            IDbProvider dbProvider = GetDbProvider(sessionFactory);
	        if (dbProvider != null)
	        {
                return new ErrorCodeExceptionTranslator(dbProvider);
	        }
	        log.Warn("Using FallbackException Translator.  Could not translate from ISessionFactory to IDbProvider");
            return new FallbackExceptionTranslator();
	        
	    }
	}