Package java.sql

Examples of java.sql.SQLTransientException


    assertFalse(this.dialect.indicatesFailure(new SQLFeatureNotSupportedException()));
    assertFalse(this.dialect.indicatesFailure(new SQLIntegrityConstraintViolationException()));
    assertFalse(this.dialect.indicatesFailure(new SQLInvalidAuthorizationSpecException()));
    assertFalse(this.dialect.indicatesFailure(new SQLSyntaxErrorException()));
    assertFalse(this.dialect.indicatesFailure(new SQLRecoverableException()));
    assertFalse(this.dialect.indicatesFailure(new SQLTransientException()));
    assertFalse(this.dialect.indicatesFailure(new SQLTimeoutException()));
    assertFalse(this.dialect.indicatesFailure(new SQLTransactionRollbackException()));
    assertFalse(this.dialect.indicatesFailure(new SQLWarning()));
    assertFalse(this.dialect.indicatesFailure(new DataTruncation(1, false, false, 1, 1)));
    assertFalse(this.dialect.indicatesFailure(new SQLDataException()));
View Full Code Here


  public static SQLException getSqlException(ServiceException e) {
    String detail = e.getMessage();
    if (detail == null) {
      return new SQLNonTransientException("Unknown Vtocc exception", e);
    } else if (detail.startsWith("retry")) {
      return new SQLTransientException("Retriable Vtocc exception: " + detail, e);
    } else if (detail.startsWith("fatal")) {
      return new SQLNonTransientException("Fatal Vtocc exception: " + detail, e);
    } else if (detail.startsWith("tx_pool_full")) {
      return new SQLTransientConnectionException(
          "Pool exhausted Vtocc exception: " + detail, e);
View Full Code Here

public class SQLTransientExceptionTest extends TestCase {

    private SQLTransientException sQLTransientException;

    protected void setUp() throws Exception {
        sQLTransientException = new SQLTransientException("MYTESTSTRING",
                "MYTESTSTRING", 1, new Exception("MYTHROWABLE"));
    }
View Full Code Here

    /**
     * @test java.sql.SQLTransientException(String)
     */
    public void test_Constructor_LString() {
        SQLTransientException sQLTransientException = new SQLTransientException(
                "MYTESTSTRING");
        assertNotNull(sQLTransientException);
        assertNull("The SQLState of SQLTransientException should be null",
                sQLTransientException.getSQLState());
        assertEquals(
                "The reason of SQLTransientException set and get should be equivalent",
                "MYTESTSTRING", sQLTransientException.getMessage());
        assertEquals("The error code of SQLTransientException should be 0",
                sQLTransientException.getErrorCode(), 0);
    }
View Full Code Here

    /**
     * @test java.sql.SQLTransientException(String)
     */
    public void test_Constructor_LString_1() {
        SQLTransientException sQLTransientException = new SQLTransientException(
                (String) null);
        assertNotNull(sQLTransientException);
        assertNull("The SQLState of SQLTransientException should be null",
                sQLTransientException.getSQLState());
        assertNull("The reason of SQLTransientException should be null",
                sQLTransientException.getMessage());
        assertEquals("The error code of SQLTransientException should be 0",
                sQLTransientException.getErrorCode(), 0);
    }
View Full Code Here

    /**
     * @test java.sql.SQLTransientException(String, String)
     */
    public void test_Constructor_LStringLString() {
        SQLTransientException sQLTransientException = new SQLTransientException(
                "MYTESTSTRING1", "MYTESTSTRING2");
        assertNotNull(sQLTransientException);
        assertEquals(
                "The SQLState of SQLTransientException set and get should be equivalent",
                "MYTESTSTRING2", sQLTransientException.getSQLState());
        assertEquals(
                "The reason of SQLTransientException set and get should be equivalent",
                "MYTESTSTRING1", sQLTransientException.getMessage());
        assertEquals("The error code of SQLTransientException should be 0",
                sQLTransientException.getErrorCode(), 0);

    }
View Full Code Here

    /**
     * @test java.sql.SQLTransientException(String, String)
     */
    public void test_Constructor_LStringLString_1() {
        SQLTransientException sQLTransientException = new SQLTransientException(
                "MYTESTSTRING", (String) null);
        assertNotNull(sQLTransientException);
        assertNull("The SQLState of SQLTransientException should be null",
                sQLTransientException.getSQLState());
        assertEquals(
                "The reason of SQLTransientException set and get should be equivalent",
                "MYTESTSTRING", sQLTransientException.getMessage());
        assertEquals("The error code of SQLTransientException should be 0",
                sQLTransientException.getErrorCode(), 0);
    }
View Full Code Here

    /**
     * @test java.sql.SQLTransientException(String, String, int, Throwable)
     */
    public void test_Constructor_LStringLStringILThrowable_21() {
        SQLTransientException sQLTransientException = new SQLTransientException(
                null, null, 0, null);
        assertNotNull(sQLTransientException);
        assertNull("The SQLState of SQLTransientException should be null",
                sQLTransientException.getSQLState());
        assertNull("The reason of SQLTransientException should be null",
                sQLTransientException.getMessage());
        assertEquals("The error code of SQLTransientException should be 0",
                sQLTransientException.getErrorCode(), 0);
        assertNull("The cause of SQLTransientException should be null",
                sQLTransientException.getCause());
    }
View Full Code Here

    /**
     * @test java.sql.SQLTransientException(String, String, int, Throwable)
     */
    public void test_Constructor_LStringLStringILThrowable_22() {
        Throwable cause = new Exception("MYTHROWABLE");
        SQLTransientException sQLTransientException = new SQLTransientException(
                null, null, -1, cause);
        assertNotNull(sQLTransientException);
        assertNull("The SQLState of SQLTransientException should be null",
                sQLTransientException.getSQLState());
        assertNull("The reason of SQLTransientException should be null",
                sQLTransientException.getMessage());
        assertEquals("The error code of SQLTransientException should be -1",
                sQLTransientException.getErrorCode(), -1);
        assertEquals(
                "The cause of SQLTransientException set and get should be equivalent",
                cause, sQLTransientException.getCause());
    }
View Full Code Here

    /**
     * @test java.sql.SQLTransientException(String, String, int, Throwable)
     */
    public void test_Constructor_LStringLStringILThrowable_23() {
        SQLTransientException sQLTransientException = new SQLTransientException(
                null, null, -1, null);
        assertNotNull(sQLTransientException);
        assertNull("The SQLState of SQLTransientException should be null",
                sQLTransientException.getSQLState());
        assertNull("The reason of SQLTransientException should be null",
                sQLTransientException.getMessage());
        assertEquals("The error code of SQLTransientException should be -1",
                sQLTransientException.getErrorCode(), -1);
        assertNull("The cause of SQLTransientException should be null",
                sQLTransientException.getCause());
    }
View Full Code Here

TOP

Related Classes of java.sql.SQLTransientException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.