Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public boolean isNeedRefreshTableEntry() {
public boolean isNeedRetryError() {
return errorCode == ResultCodes.OB_TRY_LOCK_ROW_CONFLICT.errorCode
|| errorCode == ResultCodes.OB_TRANSACTION_SET_VIOLATION.errorCode
|| errorCode == ResultCodes.OB_SCHEMA_EAGAIN.errorCode;
|| errorCode == ResultCodes.OB_SCHEMA_EAGAIN.errorCode
|| errorCode == ResultCodes.OB_TRANS_TIMEOUT.errorCode;
}

}
16 changes: 14 additions & 2 deletions src/main/java/com/alipay/oceanbase/rpc/location/LocationUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,10 @@ private static String getTableNameByGroupNameFromRemote(Connection connection, T
while (rs.next()) {
realTableName = rs.getString("table_name");
}
} catch (SQLException e) {
RUNTIME.error("getTableNameByGroupNameFromRemote meet SQL exception", e);
throw new ObTableEntryRefreshException(format("fail to get table name from remote, key=%s",
key), e, true);
} catch (ObTableNotExistException e) {
// avoid to refresh meta for ObTableNotExistException
RUNTIME.error("getTableNameByGroupNameFromRemote meet exception", e);
Expand Down Expand Up @@ -672,7 +676,8 @@ TableEntry execute(Connection connection) throws ObTableEntryRefreshException {

private static void getObVersionFromRemote(final Connection connection)
throws ObTableEntryRefreshException,
FeatureNotSupportedException {
FeatureNotSupportedException,
SQLException {
PreparedStatement ps = null;
ResultSet rs = null;
try {
Expand All @@ -684,6 +689,8 @@ private static void getObVersionFromRemote(final Connection connection)
} else {
throw new ObTableEntryRefreshException("fail to get ob version from remote");
}
} catch (SQLException e) {
throw e;
} catch (FeatureNotSupportedException e) {
throw e;
} catch (Exception e) {
Expand All @@ -704,7 +711,8 @@ private static void getObVersionFromRemote(final Connection connection)

// check tenant exist or not
private static int checkTenantExistFromRemote(final Connection connection, TableEntryKey key)
throws ObTableEntryRefreshException {
throws ObTableEntryRefreshException,
SQLException {
try (PreparedStatement ps = connection.prepareStatement(OB_TENANT_EXIST_SQL)) {
ps.setString(1, key.getTenantName());
try (ResultSet rs = ps.executeQuery()) {
Expand All @@ -713,9 +721,13 @@ private static int checkTenantExistFromRemote(final Connection connection, Table
} else {
return rs.getInt("tenant_id");
}
} catch(SQLException e) {
throw e;
} catch (Exception e) {
throw new ObTableEntryRefreshException("fail to get tenant id from remote", e);
}
} catch (SQLException e) {
throw e;
} catch (Exception e) {
throw new ObTableEntryRefreshException("fail to get tenant id from remote", e);
}
Expand Down