diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java index f502478dc..7b89c9272 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java @@ -350,7 +350,8 @@ public class DB2Dictionary else isolationLevel = conf.getTransactionIsolationConstant(); - if (fetch.getReadLockLevel() >= MixedLockLevels.LOCK_PESSIMISTIC_WRITE) + if (fetch != null + && fetch.getReadLockLevel() >= MixedLockLevels.LOCK_PESSIMISTIC_WRITE) isolationLevel = Connection.TRANSACTION_SERIALIZABLE; if (isForUpdate) {