diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java index e83c32e97..585ffd4e1 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java @@ -4033,7 +4033,11 @@ public class DBDictionary * {@link StoreException}.
* JDBC Drivers are not uniform in return values of SQLState for the same * error and hence each database specific Dictionary can specialize.
- * Default behavior is to return an empty list. + * + * + * @return an unmodifiable list of Strings representing supposedly + * uniform SQL States for a given type of StoreException. + * Default behavior is to return an empty list. */ public List/**/ getSQLStates(int exceptionType) { if (exceptionType>=0 && exceptionType + * This method is overwritten to highlight that a) the SQL State is ideally + * uniform across JDBC Drivers but not practically and b) the overwritten + * method must crate a new list to return as the super classes list is + * unmodifable. + */ + public List getSQLStates(int exceptionType) { + List original = super.getSQLStates(exceptionType); + if (exceptionType == StoreException.LOCK) { + // Can not add new codes to unmodifable list of the super class + List newStates = new ArrayList(original); + newStates.add("40XL1"); + return newStates; + } + return original; + } + }