Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

LocalSessionFactoryObject.TranslateExceptionIfPossible Method

Implementation of the PersistenceExceptionTranslator interface, as autodetected by Spring's PersistenceExceptionTranslationPostProcessor. Converts the exception if it is a HibernateException; else returns

null
to indicate an unknown exception. translate the given exception thrown by a persistence framework to a corresponding exception from Spring's generic DataAccessException hierarchy, if possible.

[Visual Basic]
Public NotOverridable Sub TranslateExceptionIfPossible( _
   ByVal ex As Exception _
) _
    Implements IPersistenceExceptionTranslator.TranslateExceptionIfPossible
[C#]
public DataAccessException TranslateExceptionIfPossible(
   Exception ex
);

Parameters

ex
The exception thrown.

Return Value

the corresponding DataAccessException (or

null
if the exception could not be translated.

Implements

IPersistenceExceptionTranslator.TranslateExceptionIfPossible

See Also

LocalSessionFactoryObject Class | Spring.Data.NHibernate Namespace | PersistenceExceptionTranslationPostProcessor