Search in sources :

Example 1 with R2dbcTransientResourceException

use of io.r2dbc.spi.R2dbcTransientResourceException in project spring-framework by spring-projects.

the class ConnectionFactoryUtilsUnitTests method messageGenerationNullMessage.

@Test
public void messageGenerationNullMessage() {
    Exception exception = ConnectionFactoryUtils.convertR2dbcException("TASK", "SOME-SQL", new R2dbcTransientResourceException());
    assertThat(exception).isInstanceOf(TransientDataAccessResourceException.class).hasMessage("TASK; SQL [SOME-SQL]; null; nested exception is io.r2dbc.spi.R2dbcTransientResourceException");
}
Also used : TransientDataAccessResourceException(org.springframework.dao.TransientDataAccessResourceException) R2dbcTransientResourceException(io.r2dbc.spi.R2dbcTransientResourceException) R2dbcDataIntegrityViolationException(io.r2dbc.spi.R2dbcDataIntegrityViolationException) ConcurrencyFailureException(org.springframework.dao.ConcurrencyFailureException) R2dbcException(io.r2dbc.spi.R2dbcException) R2dbcRollbackException(io.r2dbc.spi.R2dbcRollbackException) R2dbcTransientResourceException(io.r2dbc.spi.R2dbcTransientResourceException) UncategorizedR2dbcException(org.springframework.r2dbc.UncategorizedR2dbcException) R2dbcTimeoutException(io.r2dbc.spi.R2dbcTimeoutException) R2dbcBadGrammarException(io.r2dbc.spi.R2dbcBadGrammarException) QueryTimeoutException(org.springframework.dao.QueryTimeoutException) BadSqlGrammarException(org.springframework.r2dbc.BadSqlGrammarException) R2dbcPermissionDeniedException(io.r2dbc.spi.R2dbcPermissionDeniedException) TransientDataAccessResourceException(org.springframework.dao.TransientDataAccessResourceException) DataIntegrityViolationException(org.springframework.dao.DataIntegrityViolationException) DataAccessResourceFailureException(org.springframework.dao.DataAccessResourceFailureException) PermissionDeniedDataAccessException(org.springframework.dao.PermissionDeniedDataAccessException) R2dbcNonTransientResourceException(io.r2dbc.spi.R2dbcNonTransientResourceException) Test(org.junit.jupiter.api.Test)

Example 2 with R2dbcTransientResourceException

use of io.r2dbc.spi.R2dbcTransientResourceException in project spring-framework by spring-projects.

the class ConnectionFactoryUtilsUnitTests method shouldTranslateTransientResourceException.

@Test
public void shouldTranslateTransientResourceException() {
    Exception exception = ConnectionFactoryUtils.convertR2dbcException("", "", new R2dbcTransientResourceException(""));
    assertThat(exception).isInstanceOf(TransientDataAccessResourceException.class);
}
Also used : R2dbcTransientResourceException(io.r2dbc.spi.R2dbcTransientResourceException) R2dbcDataIntegrityViolationException(io.r2dbc.spi.R2dbcDataIntegrityViolationException) ConcurrencyFailureException(org.springframework.dao.ConcurrencyFailureException) R2dbcException(io.r2dbc.spi.R2dbcException) R2dbcRollbackException(io.r2dbc.spi.R2dbcRollbackException) R2dbcTransientResourceException(io.r2dbc.spi.R2dbcTransientResourceException) UncategorizedR2dbcException(org.springframework.r2dbc.UncategorizedR2dbcException) R2dbcTimeoutException(io.r2dbc.spi.R2dbcTimeoutException) R2dbcBadGrammarException(io.r2dbc.spi.R2dbcBadGrammarException) QueryTimeoutException(org.springframework.dao.QueryTimeoutException) BadSqlGrammarException(org.springframework.r2dbc.BadSqlGrammarException) R2dbcPermissionDeniedException(io.r2dbc.spi.R2dbcPermissionDeniedException) TransientDataAccessResourceException(org.springframework.dao.TransientDataAccessResourceException) DataIntegrityViolationException(org.springframework.dao.DataIntegrityViolationException) DataAccessResourceFailureException(org.springframework.dao.DataAccessResourceFailureException) PermissionDeniedDataAccessException(org.springframework.dao.PermissionDeniedDataAccessException) R2dbcNonTransientResourceException(io.r2dbc.spi.R2dbcNonTransientResourceException) Test(org.junit.jupiter.api.Test)

Example 3 with R2dbcTransientResourceException

use of io.r2dbc.spi.R2dbcTransientResourceException in project spring-framework by spring-projects.

the class ConnectionFactoryUtilsUnitTests method messageGenerationNullSQL.

@Test
public void messageGenerationNullSQL() {
    Exception exception = ConnectionFactoryUtils.convertR2dbcException("TASK", null, new R2dbcTransientResourceException("MESSAGE"));
    assertThat(exception).isInstanceOf(TransientDataAccessResourceException.class).hasMessage("TASK; MESSAGE; nested exception is io.r2dbc.spi.R2dbcTransientResourceException: MESSAGE");
}
Also used : TransientDataAccessResourceException(org.springframework.dao.TransientDataAccessResourceException) R2dbcTransientResourceException(io.r2dbc.spi.R2dbcTransientResourceException) R2dbcDataIntegrityViolationException(io.r2dbc.spi.R2dbcDataIntegrityViolationException) ConcurrencyFailureException(org.springframework.dao.ConcurrencyFailureException) R2dbcException(io.r2dbc.spi.R2dbcException) R2dbcRollbackException(io.r2dbc.spi.R2dbcRollbackException) R2dbcTransientResourceException(io.r2dbc.spi.R2dbcTransientResourceException) UncategorizedR2dbcException(org.springframework.r2dbc.UncategorizedR2dbcException) R2dbcTimeoutException(io.r2dbc.spi.R2dbcTimeoutException) R2dbcBadGrammarException(io.r2dbc.spi.R2dbcBadGrammarException) QueryTimeoutException(org.springframework.dao.QueryTimeoutException) BadSqlGrammarException(org.springframework.r2dbc.BadSqlGrammarException) R2dbcPermissionDeniedException(io.r2dbc.spi.R2dbcPermissionDeniedException) TransientDataAccessResourceException(org.springframework.dao.TransientDataAccessResourceException) DataIntegrityViolationException(org.springframework.dao.DataIntegrityViolationException) DataAccessResourceFailureException(org.springframework.dao.DataAccessResourceFailureException) PermissionDeniedDataAccessException(org.springframework.dao.PermissionDeniedDataAccessException) R2dbcNonTransientResourceException(io.r2dbc.spi.R2dbcNonTransientResourceException) Test(org.junit.jupiter.api.Test)

Example 4 with R2dbcTransientResourceException

use of io.r2dbc.spi.R2dbcTransientResourceException in project spring-framework by spring-projects.

the class ConnectionFactoryUtilsUnitTests method messageGeneration.

@Test
public void messageGeneration() {
    Exception exception = ConnectionFactoryUtils.convertR2dbcException("TASK", "SOME-SQL", new R2dbcTransientResourceException("MESSAGE"));
    assertThat(exception).isInstanceOf(TransientDataAccessResourceException.class).hasMessage("TASK; SQL [SOME-SQL]; MESSAGE; nested exception is io.r2dbc.spi.R2dbcTransientResourceException: MESSAGE");
}
Also used : TransientDataAccessResourceException(org.springframework.dao.TransientDataAccessResourceException) R2dbcTransientResourceException(io.r2dbc.spi.R2dbcTransientResourceException) R2dbcDataIntegrityViolationException(io.r2dbc.spi.R2dbcDataIntegrityViolationException) ConcurrencyFailureException(org.springframework.dao.ConcurrencyFailureException) R2dbcException(io.r2dbc.spi.R2dbcException) R2dbcRollbackException(io.r2dbc.spi.R2dbcRollbackException) R2dbcTransientResourceException(io.r2dbc.spi.R2dbcTransientResourceException) UncategorizedR2dbcException(org.springframework.r2dbc.UncategorizedR2dbcException) R2dbcTimeoutException(io.r2dbc.spi.R2dbcTimeoutException) R2dbcBadGrammarException(io.r2dbc.spi.R2dbcBadGrammarException) QueryTimeoutException(org.springframework.dao.QueryTimeoutException) BadSqlGrammarException(org.springframework.r2dbc.BadSqlGrammarException) R2dbcPermissionDeniedException(io.r2dbc.spi.R2dbcPermissionDeniedException) TransientDataAccessResourceException(org.springframework.dao.TransientDataAccessResourceException) DataIntegrityViolationException(org.springframework.dao.DataIntegrityViolationException) DataAccessResourceFailureException(org.springframework.dao.DataAccessResourceFailureException) PermissionDeniedDataAccessException(org.springframework.dao.PermissionDeniedDataAccessException) R2dbcNonTransientResourceException(io.r2dbc.spi.R2dbcNonTransientResourceException) Test(org.junit.jupiter.api.Test)

Aggregations

R2dbcBadGrammarException (io.r2dbc.spi.R2dbcBadGrammarException)4 R2dbcDataIntegrityViolationException (io.r2dbc.spi.R2dbcDataIntegrityViolationException)4 R2dbcException (io.r2dbc.spi.R2dbcException)4 R2dbcNonTransientResourceException (io.r2dbc.spi.R2dbcNonTransientResourceException)4 R2dbcPermissionDeniedException (io.r2dbc.spi.R2dbcPermissionDeniedException)4 R2dbcRollbackException (io.r2dbc.spi.R2dbcRollbackException)4 R2dbcTimeoutException (io.r2dbc.spi.R2dbcTimeoutException)4 R2dbcTransientResourceException (io.r2dbc.spi.R2dbcTransientResourceException)4 Test (org.junit.jupiter.api.Test)4 ConcurrencyFailureException (org.springframework.dao.ConcurrencyFailureException)4 DataAccessResourceFailureException (org.springframework.dao.DataAccessResourceFailureException)4 DataIntegrityViolationException (org.springframework.dao.DataIntegrityViolationException)4 PermissionDeniedDataAccessException (org.springframework.dao.PermissionDeniedDataAccessException)4 QueryTimeoutException (org.springframework.dao.QueryTimeoutException)4 TransientDataAccessResourceException (org.springframework.dao.TransientDataAccessResourceException)4 BadSqlGrammarException (org.springframework.r2dbc.BadSqlGrammarException)4 UncategorizedR2dbcException (org.springframework.r2dbc.UncategorizedR2dbcException)4