use of java.sql.SQLTransientException in project sis by apache.
the class AuthorityFactories method failure.
/**
* Notifies that a factory is unavailable, but without giving a fallback and without logging.
* The caller is responsible for throwing an exception, or for logging a warning and provide its own fallback.
*
* @return {@code false} if the caller can try again, or {@code true} if the failure can be considered final.
*/
static boolean failure(final UnavailableFactoryException e) {
if (!(e.getCause() instanceof SQLTransientException)) {
final AuthorityFactory unavailable = e.getUnavailableFactory();
synchronized (EPSG) {
final GeodeticAuthorityFactory factory = EPSG[0];
if (factory == EPSGFactoryFallback.INSTANCE) {
// May have been set in another thread.
return false;
}
if (unavailable == factory) {
ALL.reload();
EPSG[0] = EPSGFactoryFallback.INSTANCE;
return false;
}
}
}
return true;
}
Aggregations