1 10 11 package com.triactive.jdo.store; 12 13 import java.util.Arrays ; 14 15 16 24 25 public class PostgreSQLSQLState extends SQLState 26 { 27 36 37 public PostgreSQLSQLState(String s) throws IllegalArgumentException 38 { 39 super(s); 40 } 41 42 43 public boolean isWorthRetrying() 44 { 45 if (Arrays.binarySearch(ClassCode.NOT_RETRYABLE, classCode()) >= 0) 46 return false; 47 else 48 return true; 49 } 50 51 52 56 57 public static class ClassCode 58 { 59 60 private ClassCode() {} 61 62 public static final String 63 SUCCESSFUL_COMPLETION = "00", 64 WARNING = "01", 65 NO_DATA = "02", 66 SQL_STATEMENT_NOT_YET_COMPLETE = "03", 67 CONNECTION_EXCEPTION = "08", 68 TRIGGERED_ACTION_EXCEPTION = "09", 69 FEATURE_NOT_SUPPORTED = "0A", 70 INVALID_TRANSACTION_INITIATION = "0B", 71 LOCATOR_EXCEPTION = "0F", 72 INVALID_GRANTOR = "0L", 73 INVALID_ROLE_SPECIFICATION = "0P", 74 CARDINALITY_VIOLATION = "21", 75 DATA_EXCEPTION = "22", 76 INTEGRITY_CONSTRAINT_VIOLATION = "23", 77 INVALID_CURSOR_STATE = "24", 78 INVALID_TRANSACTION_STATE = "25", 79 INVALID_SQL_STATEMENT_NAME = "26", 80 TRIGGERED_DATA_CHANGE_VIOLATION = "27", 81 INVALID_AUTHORIZATION_SPECIFICATION = "28", 82 DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST = "2B", 83 INVALID_TRANSACTION_TERMINATION = "2D", 84 SQL_ROUTINE_EXCEPTION = "2F", 85 INVALID_CURSOR_NAME = "34", 86 EXTERNAL_ROUTINE_EXCEPTION = "38", 87 EXTERNAL_ROUTINE_INVOCATION_EXCEPTION = "39", 88 INVALID_CATALOG_NAME = "3D", 89 INVALID_SCHEMA_NAME = "3F", 90 TRANSACTION_ROLLBACK = "40", 91 SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION = "42", 92 WITH_CHECK_OPTION_VIOLATION = "44", 93 INSUFFICIENT_RESOURCES = "53", 94 PROGRAM_LIMIT_EXCEEDED = "54", 95 OBJECT_NOT_IN_PREREQUISITE_STATE = "55", 96 OPERATOR_INTERVENTION = "57", 97 SYSTEM_ERROR = "58", 98 CONFIG_FILE_ERROR = "F0", 99 INTERNAL_ERROR = "XX"; 100 101 106 public static final String [] NOT_RETRYABLE = 107 { 108 109 SUCCESSFUL_COMPLETION, 110 WARNING, 111 NO_DATA, 112 SQL_STATEMENT_NOT_YET_COMPLETE, 113 TRIGGERED_ACTION_EXCEPTION, 115 FEATURE_NOT_SUPPORTED, 116 INVALID_TRANSACTION_INITIATION, 117 LOCATOR_EXCEPTION, 118 INVALID_GRANTOR, 119 INVALID_ROLE_SPECIFICATION, 120 CARDINALITY_VIOLATION, 121 DATA_EXCEPTION, 122 INTEGRITY_CONSTRAINT_VIOLATION, 123 INVALID_SQL_STATEMENT_NAME, 126 TRIGGERED_DATA_CHANGE_VIOLATION, 127 INVALID_AUTHORIZATION_SPECIFICATION, 128 DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST, 129 SQL_ROUTINE_EXCEPTION, 131 INVALID_CURSOR_NAME, 132 EXTERNAL_ROUTINE_EXCEPTION, 133 EXTERNAL_ROUTINE_INVOCATION_EXCEPTION, 134 INVALID_CATALOG_NAME, 135 INVALID_SCHEMA_NAME, 136 SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION, 138 WITH_CHECK_OPTION_VIOLATION, 139 PROGRAM_LIMIT_EXCEEDED, 141 CONFIG_FILE_ERROR, 145 INTERNAL_ERROR 146 }; 147 } 148 } 149 | Popular Tags |