/// <summary>
        /// Converts the ADO.NET access exception to an appropriate exception from the
        /// <code>org.springframework.dao</code> hierarchy. Can be overridden in subclasses.
        /// </summary>
        /// <param name="ex">ADOException that occured, wrapping underlying ADO.NET exception.</param>
        /// <returns>
        /// the corresponding DataAccessException instance
        /// </returns>
        protected virtual DataAccessException ConvertAdoAccessException(ADOException ex)
        {
            string sqlString = (ex.SqlString != null) ? ex.SqlString.ToString() : string.Empty;

            return(AdoExceptionTranslator.Translate(
                       "Hibernate operation: " + ex.Message, sqlString, ex.InnerException));
        }
Beispiel #2
0
 /// <summary>
 /// Converts the ADO.NET access exception to an appropriate exception from the
 /// <code>org.springframework.dao</code> hierarchy. Can be overridden in subclasses.
 /// </summary>
 /// <remarks>
 /// <note>
 /// Note that a direct SQLException can just occur when callback code
 /// performs direct ADO.NET access via <code>ISession.Connection()</code>.
 /// </note>
 /// </remarks>
 /// <param name="ex">The ADO.NET exception.</param>
 /// <returns>The corresponding DataAccessException instance</returns>
 protected virtual DataAccessException ConvertAdoAccessException(Exception ex)
 {
     return(AdoExceptionTranslator.Translate("Hibernate operation", null, ex));
 }
Beispiel #3
0
 /// <summary>
 /// Converts the ADO.NET access exception to an appropriate exception from the
 /// <code>org.springframework.dao</code> hierarchy. Can be overridden in subclasses.
 /// </summary>
 /// <param name="ex">ADOException that occured, wrapping underlying ADO.NET exception.</param>
 /// <returns>
 /// the corresponding DataAccessException instance
 /// </returns>
 protected virtual DataAccessException ConvertAdoAccessException(ADOException ex)
 {
     return(AdoExceptionTranslator.Translate(
                "Hibernate operation: " + ex.Message, null, ex.InnerException));
 }