fix for OPENJPA-222 .Update the getForUpdateClause, instead of overriding the toSelect

git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@530163 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David J. Wisneski 2007-04-18 21:26:20 +00:00
parent 1af9d83d1b
commit 0df6a69703
1 changed files with 9 additions and 9 deletions

View File

@ -245,11 +245,7 @@ public class DB2Dictionary
else
isolationLevel = conf.getTransactionIsolationConstant();
if (!forUpdate) {
// This sql is not for update so add FOR Read Only clause
forUpdateString.append(" ").append(forReadOnlyClause)
.append(" ");
} else {
if (forUpdate) {
switch(db2ServerType) {
case db2ISeriesV5R3AndEarlier:
@ -266,22 +262,26 @@ public class DB2Dictionary
case db2ZOSV8x:
case db2UDBV82AndLater:
if (isolationLevel == Connection.TRANSACTION_SERIALIZABLE) {
forUpdateString.append(" ").append(withRRClause)
forUpdateString.append(" ").append(forReadOnlyClause)
.append(" ").append(withRRClause)
.append(" ").append(useKeepUpdateLockClause)
.append(" ");
} else {
forUpdateString.append(" ").append(withRSClause)
forUpdateString.append(" ").append(forReadOnlyClause)
.append(" ").append(withRSClause)
.append(" ").append(useKeepUpdateLockClause)
.append(" ");
}
break;
case db2ISeriesV5R4AndLater:
if (isolationLevel == Connection.TRANSACTION_SERIALIZABLE) {
forUpdateString.append(" ").append(withRRClause)
forUpdateString.append(" ").append(forReadOnlyClause)
.append(" ").append(withRRClause)
.append(" ").append(useKeepExclusiveLockClause)
.append(" ");
} else {
forUpdateString.append(" ").append(withRSClause)
forUpdateString.append(" ").append(forReadOnlyClause)
.append(" ").append(withRSClause)
.append(" ").append(useKeepExclusiveLockClause)
.append(" ");
}