SessionFactoryUtils.convertHibernateAccessException
method that converts them to exceptions that are compatible with the org.springframework.dao
exception hierarchy (like HibernateTemplate does). This can be turned off if the raw exceptions are preferred. This class can be considered a declarative alternative to HibernateTemplate's callback approach. The advantages are:
The drawback is the dependency on interceptor configuration. However, note that this interceptor is usually not necessary in scenarios where the data access code always executes within transactions. A transaction will always have a thread-bound Session in the first place, so adding this interceptor to the configuration just adds value when fine-tuning Session settings like the flush mode - or when relying on exception translation. @author Juergen Hoeller @since 1.2 @see org.hibernate.SessionFactory#getCurrentSession() @see HibernateTransactionManager @see HibernateTemplate
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|