From bb01292ce90b5ad2e733390bf4cfcb238989e1b8 Mon Sep 17 00:00:00 2001 From: Albert Lee Date: Sun, 5 Apr 2009 22:37:24 +0000 Subject: [PATCH] OPENJPA-957 - Guard NPE as fetch may be null in getForUpdateClause. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@762177 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) {