mirror of https://github.com/apache/openjpa.git
OPENJPA-884: Logging oversight in DB2Dictionary
https://issues.apache.org/jira/browse/OPENJPA-884 git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@749077 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cc38e27eef
commit
efc6ba4735
|
@ -234,8 +234,8 @@ public class DB2Dictionary
|
||||||
conn = super.decorate(conn);
|
conn = super.decorate(conn);
|
||||||
|
|
||||||
if (conf.getTransactionIsolationConstant() == -1
|
if (conf.getTransactionIsolationConstant() == -1
|
||||||
&& conn.getTransactionIsolation() < conn.TRANSACTION_READ_COMMITTED)
|
&& conn.getTransactionIsolation() < Connection.TRANSACTION_READ_COMMITTED)
|
||||||
conn.setTransactionIsolation(conn.TRANSACTION_READ_COMMITTED);
|
conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
|
||||||
|
|
||||||
return conn;
|
return conn;
|
||||||
}
|
}
|
||||||
|
@ -275,7 +275,7 @@ public class DB2Dictionary
|
||||||
db2ServerType = db2UDBV82OrLater;
|
db2ServerType = db2UDBV82OrLater;
|
||||||
}
|
}
|
||||||
|
|
||||||
// verify that databae product is supported
|
// verify that database product is supported
|
||||||
if (db2ServerType == 0 || maj == 0)
|
if (db2ServerType == 0 || maj == 0)
|
||||||
throw new UnsupportedException(_loc.get("db-not-supported",
|
throw new UnsupportedException(_loc.get("db-not-supported",
|
||||||
new Object[] {databaseProductName, databaseProductVersion }));
|
new Object[] {databaseProductName, databaseProductVersion }));
|
||||||
|
@ -340,9 +340,7 @@ public class DB2Dictionary
|
||||||
int isolationLevel;
|
int isolationLevel;
|
||||||
// For db2UDBV81OrEarlier and db2ISeriesV5R3OrEarlier:
|
// For db2UDBV81OrEarlier and db2ISeriesV5R3OrEarlier:
|
||||||
// "optimize for" clause appears before "for update" clause.
|
// "optimize for" clause appears before "for update" clause.
|
||||||
StringBuffer forUpdateString = new StringBuffer(
|
StringBuffer forUpdateString = new StringBuffer(getOptimizeClause(sel));
|
||||||
getOptimizeClause(sel));
|
|
||||||
try {
|
|
||||||
// Determine the isolationLevel; the fetch
|
// Determine the isolationLevel; the fetch
|
||||||
// configuration data overrides the persistence.xml value
|
// configuration data overrides the persistence.xml value
|
||||||
if (fetch != null && fetch.getIsolation() != -1)
|
if (fetch != null && fetch.getIsolation() != -1)
|
||||||
|
@ -357,39 +355,35 @@ public class DB2Dictionary
|
||||||
if (isolationLevel == Connection.TRANSACTION_SERIALIZABLE)
|
if (isolationLevel == Connection.TRANSACTION_SERIALIZABLE)
|
||||||
forUpdateString.append(" ").append(forUpdateClause);
|
forUpdateString.append(" ").append(forUpdateClause);
|
||||||
else
|
else
|
||||||
forUpdateString.append(" ").append(forUpdate)
|
forUpdateString.append(" ").append(forUpdate).append(" ")
|
||||||
.append(" ").append(withRSClause);
|
.append(withRSClause);
|
||||||
break;
|
break;
|
||||||
case db2ZOSV8xOrLater:
|
case db2ZOSV8xOrLater:
|
||||||
case db2UDBV82OrLater:
|
case db2UDBV82OrLater:
|
||||||
if (isolationLevel == Connection.TRANSACTION_SERIALIZABLE) {
|
if (isolationLevel == Connection.TRANSACTION_SERIALIZABLE) {
|
||||||
forUpdateString.append(" ").append(forReadOnlyClause)
|
forUpdateString.append(" ").append(forReadOnlyClause)
|
||||||
.append(" ").append(withRRClause)
|
.append(" ").append(withRRClause).append(" ").append(
|
||||||
.append(" ").append(useKeepUpdateLockClause);
|
useKeepUpdateLockClause);
|
||||||
} else {
|
} else {
|
||||||
forUpdateString.append(" ").append(forReadOnlyClause)
|
forUpdateString.append(" ").append(forReadOnlyClause)
|
||||||
.append(" ").append(withRSClause)
|
.append(" ").append(withRSClause).append(" ").append(
|
||||||
.append(" ").append(useKeepUpdateLockClause);
|
useKeepUpdateLockClause);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case db2ISeriesV5R4OrLater:
|
case db2ISeriesV5R4OrLater:
|
||||||
if (isolationLevel == Connection.TRANSACTION_SERIALIZABLE) {
|
if (isolationLevel == Connection.TRANSACTION_SERIALIZABLE) {
|
||||||
forUpdateString.append(" ").append(forReadOnlyClause)
|
forUpdateString.append(" ").append(forReadOnlyClause)
|
||||||
.append(" ").append(withRRClause)
|
.append(" ").append(withRRClause).append(" ").append(
|
||||||
.append(" ").append(useKeepExclusiveLockClause);
|
useKeepExclusiveLockClause);
|
||||||
} else {
|
} else {
|
||||||
forUpdateString.append(" ").append(forReadOnlyClause)
|
forUpdateString.append(" ").append(forReadOnlyClause)
|
||||||
.append(" ").append(withRSClause)
|
.append(" ").append(withRSClause).append(" ").append(
|
||||||
.append(" ").append(useKeepExclusiveLockClause);
|
useKeepExclusiveLockClause);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
if (log.isTraceEnabled())
|
|
||||||
log.error(e.toString(),e);
|
|
||||||
}
|
|
||||||
return forUpdateString.toString();
|
return forUpdateString.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -514,8 +508,8 @@ public class DB2Dictionary
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append exception information from SQLCA to the exsisting
|
* Append exception information from SQLCA to the existing
|
||||||
* exception meassage
|
* exception message
|
||||||
*/
|
*/
|
||||||
private String appendExtendedExceptionMsg(String msg, SQLException sqle){
|
private String appendExtendedExceptionMsg(String msg, SQLException sqle){
|
||||||
final String GETSQLCA ="getSqlca";
|
final String GETSQLCA ="getSqlca";
|
||||||
|
@ -827,7 +821,7 @@ public class DB2Dictionary
|
||||||
Column pkColumn) {
|
Column pkColumn) {
|
||||||
if (isDB2ZOSV8xOrLater()) {
|
if (isDB2ZOSV8xOrLater()) {
|
||||||
// build the index for the sequence tables
|
// build the index for the sequence tables
|
||||||
// the index name will the fully qualified table name + _IDX
|
// the index name will be the fully qualified table name + _IDX
|
||||||
Table tab = schema.getTable(table);
|
Table tab = schema.getTable(table);
|
||||||
Index idx = tab.addIndex(tab.getFullName() + "_IDX");
|
Index idx = tab.addIndex(tab.getFullName() + "_IDX");
|
||||||
idx.setUnique(true);
|
idx.setUnique(true);
|
||||||
|
|
Loading…
Reference in New Issue