mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 08:35:13 +00:00
HHH-7298 seems DB2 do not support set lock timeout from statement level
This commit is contained in:
parent
0996a970ab
commit
c02de61f24
@ -176,67 +176,67 @@ public DB2Dialect() {
|
|||||||
|
|
||||||
getDefaultProperties().setProperty( Environment.STATEMENT_BATCH_SIZE, NO_BATCH );
|
getDefaultProperties().setProperty( Environment.STATEMENT_BATCH_SIZE, NO_BATCH );
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public String getLowercaseFunction() {
|
public String getLowercaseFunction() {
|
||||||
return "lcase";
|
return "lcase";
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public String getAddColumnString() {
|
public String getAddColumnString() {
|
||||||
return "add column";
|
return "add column";
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean dropConstraints() {
|
public boolean dropConstraints() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean supportsIdentityColumns() {
|
public boolean supportsIdentityColumns() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public String getIdentitySelectString() {
|
public String getIdentitySelectString() {
|
||||||
return "values identity_val_local()";
|
return "values identity_val_local()";
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public String getIdentityColumnString() {
|
public String getIdentityColumnString() {
|
||||||
return "generated by default as identity"; //not null ... (start with 1) is implicit
|
return "generated by default as identity"; //not null ... (start with 1) is implicit
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public String getIdentityInsertString() {
|
public String getIdentityInsertString() {
|
||||||
return "default";
|
return "default";
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public String getSequenceNextValString(String sequenceName) {
|
public String getSequenceNextValString(String sequenceName) {
|
||||||
return "values nextval for " + sequenceName;
|
return "values nextval for " + sequenceName;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public String getCreateSequenceString(String sequenceName) {
|
public String getCreateSequenceString(String sequenceName) {
|
||||||
return "create sequence " + sequenceName;
|
return "create sequence " + sequenceName;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public String getDropSequenceString(String sequenceName) {
|
public String getDropSequenceString(String sequenceName) {
|
||||||
return "drop sequence " + sequenceName + " restrict";
|
return "drop sequence " + sequenceName + " restrict";
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean supportsSequences() {
|
public boolean supportsSequences() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean supportsPooledSequences() {
|
public boolean supportsPooledSequences() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public String getQuerySequencesString() {
|
public String getQuerySequencesString() {
|
||||||
return "select seqname from sysibm.syssequences";
|
return "select seqname from sysibm.syssequences";
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean supportsLimit() {
|
public boolean supportsLimit() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean supportsVariableLimit() {
|
public boolean supportsVariableLimit() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public String getLimitString(String sql, int offset, int limit) {
|
public String getLimitString(String sql, int offset, int limit) {
|
||||||
if ( offset == 0 ) {
|
if ( offset == 0 ) {
|
||||||
return sql + " fetch first " + limit + " rows only";
|
return sql + " fetch first " + limit + " rows only";
|
||||||
@ -262,30 +262,36 @@ public String getLimitString(String sql, int offset, int limit) {
|
|||||||
*
|
*
|
||||||
* @return zeroBasedFirstResult
|
* @return zeroBasedFirstResult
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int convertToFirstRowValue(int zeroBasedFirstResult) {
|
public int convertToFirstRowValue(int zeroBasedFirstResult) {
|
||||||
return zeroBasedFirstResult;
|
return zeroBasedFirstResult;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public String getForUpdateString() {
|
public String getForUpdateString() {
|
||||||
return " for read only with rs use and keep update locks";
|
return " for read only with rs use and keep update locks";
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean useMaxForLimit() {
|
public boolean useMaxForLimit() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean supportsOuterJoinForUpdate() {
|
public boolean supportsOuterJoinForUpdate() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean supportsNotNullUnique() {
|
public boolean supportsNotNullUnique() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean supportsExistsInSelect() {
|
public boolean supportsExistsInSelect() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
//as far as I know, DB2 doesn't support this
|
||||||
|
@Override
|
||||||
|
public boolean supportsLockTimeouts() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
public String getSelectClauseNullString(int sqlType) {
|
public String getSelectClauseNullString(int sqlType) {
|
||||||
String literal;
|
String literal;
|
||||||
switch ( sqlType ) {
|
switch ( sqlType ) {
|
||||||
@ -326,15 +332,15 @@ public static void main(String[] args) {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean supportsUnionAll() {
|
public boolean supportsUnionAll() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public int registerResultSetOutParameter(CallableStatement statement, int col) throws SQLException {
|
public int registerResultSetOutParameter(CallableStatement statement, int col) throws SQLException {
|
||||||
return col;
|
return col;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public ResultSet getResultSet(CallableStatement ps) throws SQLException {
|
public ResultSet getResultSet(CallableStatement ps) throws SQLException {
|
||||||
boolean isResultSet = ps.execute();
|
boolean isResultSet = ps.execute();
|
||||||
// This assumes you will want to ignore any update counts
|
// This assumes you will want to ignore any update counts
|
||||||
@ -346,35 +352,35 @@ public ResultSet getResultSet(CallableStatement ps) throws SQLException {
|
|||||||
// but you can't do it now or the ResultSet you just got will be closed
|
// but you can't do it now or the ResultSet you just got will be closed
|
||||||
return rs;
|
return rs;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean supportsCommentOn() {
|
public boolean supportsCommentOn() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean supportsTemporaryTables() {
|
public boolean supportsTemporaryTables() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public String getCreateTemporaryTableString() {
|
public String getCreateTemporaryTableString() {
|
||||||
return "declare global temporary table";
|
return "declare global temporary table";
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public String getCreateTemporaryTablePostfix() {
|
public String getCreateTemporaryTablePostfix() {
|
||||||
return "not logged";
|
return "not logged";
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public String generateTemporaryTableName(String baseTableName) {
|
public String generateTemporaryTableName(String baseTableName) {
|
||||||
return "session." + super.generateTemporaryTableName( baseTableName );
|
return "session." + super.generateTemporaryTableName( baseTableName );
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean supportsCurrentTimestampSelection() {
|
public boolean supportsCurrentTimestampSelection() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public String getCurrentTimestampSelectString() {
|
public String getCurrentTimestampSelectString() {
|
||||||
return "values current timestamp";
|
return "values current timestamp";
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean isCurrentTimestampSelectStringCallable() {
|
public boolean isCurrentTimestampSelectStringCallable() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -387,6 +393,7 @@ public boolean isCurrentTimestampSelectStringCallable() {
|
|||||||
*
|
*
|
||||||
* @return True.
|
* @return True.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean supportsParametersInInsertSelect() {
|
public boolean supportsParametersInInsertSelect() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -397,32 +404,34 @@ public boolean supportsParametersInInsertSelect() {
|
|||||||
*
|
*
|
||||||
* @return True.
|
* @return True.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean requiresCastingOfParametersInSelectClause() {
|
public boolean requiresCastingOfParametersInSelectClause() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() {
|
public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//DB2 v9.1 doesn't support 'cross join' syntax
|
//DB2 v9.1 doesn't support 'cross join' syntax
|
||||||
|
@Override
|
||||||
public String getCrossJoinSeparator() {
|
public String getCrossJoinSeparator() {
|
||||||
return ", ";
|
return ", ";
|
||||||
}
|
}
|
||||||
// Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
@Override
|
||||||
public boolean supportsEmptyInList() {
|
public boolean supportsEmptyInList() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean supportsLobValueChangePropogation() {
|
public boolean supportsLobValueChangePropogation() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean doesReadCommittedCauseWritersToBlockReaders() {
|
public boolean doesReadCommittedCauseWritersToBlockReaders() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean supportsTupleDistinctCounts() {
|
public boolean supportsTupleDistinctCounts() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user