use of org.hibernate.exception.spi.SQLExceptionConversionDelegate in project hibernate-orm by hibernate.
the class PostgreSQL81DialectTestCase method testTimeoutException.
@Test
public void testTimeoutException() {
PostgreSQL81Dialect dialect = new PostgreSQL81Dialect();
SQLExceptionConversionDelegate delegate = dialect.buildSQLExceptionConversionDelegate();
assertNotNull(delegate);
JDBCException exception = delegate.convert(new SQLException("Lock Not Available", "55P03"), "", "");
assertTrue(exception instanceof PessimisticLockException);
}
use of org.hibernate.exception.spi.SQLExceptionConversionDelegate in project hibernate-orm by hibernate.
the class PostgreSQL81DialectTestCase method testDeadlockException.
@Test
public void testDeadlockException() {
PostgreSQL81Dialect dialect = new PostgreSQL81Dialect();
SQLExceptionConversionDelegate delegate = dialect.buildSQLExceptionConversionDelegate();
assertNotNull(delegate);
JDBCException exception = delegate.convert(new SQLException("Deadlock Detected", "40P01"), "", "");
assertTrue(exception instanceof LockAcquisitionException);
}
Aggregations