Interface MishandledExceptions
public interface MishandledExceptions
Illustrates how not to handle an exception thrown by a call into PostgreSQL.
Such an exception must either be rethrown (or result in some higher-level exception being rethrown) or cleared by rolling back the transaction or a previously-established savepoint. If it is simply caught and not propagated and the error condition is not cleared, no further calls into PostgreSQL functionality can be made within the containing transaction.
- See Also:
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic Stringmishandle(boolean twice, boolean succeed) Executes an SQL statement that produces an error (twice, if requested), catching the resulting exception but not propagating it or rolling back a savepoint; then throws an unrelated exception if succeed is false.
-
Method Details
-
mishandle
@Function(schema="javatest") static String mishandle(boolean twice, @SQLType(defaultValue="true") boolean succeed) throws SQLException Executes an SQL statement that produces an error (twice, if requested), catching the resulting exception but not propagating it or rolling back a savepoint; then throws an unrelated exception if succeed is false.- Throws:
SQLException
-