提交 04021cc8 编写于 作者: S Serge Rider

Cache errors handle


Former-commit-id: 2304c20b
上级 83855504
......@@ -903,10 +903,10 @@ public class PostgreDatabase extends JDBCRemoteInstance<PostgreDataSource>
}
@Override
protected boolean handleCacheReadError(DBException error) {
protected boolean handleCacheReadError(Exception error) {
// #271, #501: in some databases (AWS?) pg_authid is not accessible
// FIXME: maybe some better workaround?
if (PostgreConstants.EC_PERMISSION_DENIED.equals(error.getDatabaseState())) {
if (error instanceof DBException && PostgreConstants.EC_PERMISSION_DENIED.equals(((DBException) error).getDatabaseState())) {
log.warn(error);
setCache(Collections.emptyList());
return true;
......
......@@ -131,10 +131,10 @@ public abstract class JDBCObjectCache<OWNER extends DBSObject, OBJECT extends DB
}
}
}
} catch (SQLException ex) {
} catch (Exception ex) {
throw new DBException(ex, dataSource);
}
} catch (DBException e) {
} catch (Exception e) {
if (!handleCacheReadError(e)) {
throw e;
}
......@@ -157,7 +157,7 @@ public abstract class JDBCObjectCache<OWNER extends DBSObject, OBJECT extends DB
}
// Can be implemented to provide custom cache error handler
protected boolean handleCacheReadError(DBException error) {
protected boolean handleCacheReadError(Exception error) {
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册