fix to OPENJPA-182 commit

git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@525262 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David J. Wisneski 2007-04-03 20:24:39 +00:00
parent 4754f0921c
commit 6fe50aa433
1 changed files with 7 additions and 5 deletions

View File

@ -45,6 +45,8 @@ public class DB2Dictionary
private static final String useKeepUpdateLockClause= "USE AND KEEP UPDATE LOCKS";
private static final String useKeepExclusiveLockClause="USE AND KEEP EXCLUSIVE LOCKS";
private static final String forReadOnlyClause = "FOR READ ONLY";
public static final String UPDATE_HINT = "openjpa.hint.updateClause";
public static final String ISOLATION_HINT = "openjpa.hint.isolationLevel";
public DB2Dictionary() {
platform = "DB2";
validationSQL = "SELECT DISTINCT(CURRENT TIMESTAMP) FROM "
@ -234,20 +236,20 @@ public class DB2Dictionary
try {
// Determine the update clause/isolationLevel the hint
// overrides the persistence.xml value
if (fetch != null && fetch.getHint("openjpa.hint.updateClause")
if (fetch != null && fetch.getHint(UPDATE_HINT)
!=null )
updateClause = ((Boolean)fetch.
getHint("openjpa.hint.updateClause")).booleanValue();
getHint(UPDATE_HINT)).booleanValue();
else
updateClause = forUpdate;
if (fetch != null &&fetch.getHint("openjpa.hint.isolationLevel")
if (fetch != null &&fetch.getHint(ISOLATION_HINT)
!=null )
isolationLevel = (String)fetch.
getHint("openjpa.hint.isolationLevel");
getHint(ISOLATION_HINT);
else
isolationLevel = conf.getTransactionIsolation();
if (updateClause == false)
//This sql is not for update so add FOR Read Only clause
// This sql is not for update so add FOR Read Only clause
forUpdateString.append(" ").append(forReadOnlyClause)
.append(" ");
else if (updateClause == true){