/** * Check the result set is in sync with the currentRow attribute. This is * important to ensure that the user hasn't modified the current row. */ private void verifyCursorPosition(long expectedCurrentRow) throws SQLException { if (verifyCursorPosition) { if (expectedCurrentRow != this.rs.getRow()) { throw new InvalidDataAccessResourceUsageException("Unexpected cursor position change."); } } }
logger.error(e.getMessage(), e); throw new CommitException("It appears that the Ikasan database has not been setup. Please go to the" + " setup screen by clicking the link at the top right of this screen.", e);
@Override public RedisClusterConnection getClusterConnection() { if (!redisson.getConfig().isClusterConfig()) { throw new InvalidDataAccessResourceUsageException("Redisson is not in Cluster mode"); } return new RedissonClusterConnection(redisson); }
@Override public RedisClusterConnection getClusterConnection() { if (!redisson.getConfig().isClusterConfig()) { throw new InvalidDataAccessResourceUsageException("Redisson is not in Cluster mode"); } return new RedissonClusterConnection(redisson); }
@Override public RedisClusterConnection getClusterConnection() { if (!redisson.getConfig().isClusterConfig()) { throw new InvalidDataAccessResourceUsageException("Redisson is not in Cluster mode"); } return new RedissonClusterConnection(redisson); }
@Override public void init(DataSource dataSource) throws Exception { super.init(dataSource); String version = JdbcUtils.extractDatabaseMetaData(dataSource, "getDatabaseProductVersion").toString(); if (!isDerbyVersionSupported(version)) { throw new InvalidDataAccessResourceUsageException("Apache Derby version " + version + " is not supported by this class, Only version " + MINIMAL_DERBY_VERSION + " or later is supported"); } }
@Override public RedisSentinelConnection getSentinelConnection() { if (!redisson.getConfig().isSentinelConfig()) { throw new InvalidDataAccessResourceUsageException("Redisson is not in Sentinel mode"); } SentinelConnectionManager manager = ((SentinelConnectionManager)((Redisson)redisson).getConnectionManager()); for (RedisClient client : manager.getSentinels()) { org.redisson.client.RedisConnection connection = client.connect(); try { String res = connection.sync(RedisCommands.PING); if ("pong".equalsIgnoreCase(res)) { return new RedissonSentinelConnection(connection); } } catch (Exception e) { log.warn("Can't connect to " + client, e); connection.closeAsync(); } } throw new InvalidDataAccessResourceUsageException("Sentinels are not found"); }
@Override public RedisSentinelConnection getSentinelConnection() { if (!redisson.getConfig().isSentinelConfig()) { throw new InvalidDataAccessResourceUsageException("Redisson is not in Sentinel mode"); } SentinelConnectionManager manager = ((SentinelConnectionManager)((Redisson)redisson).getConnectionManager()); for (RedisClient client : manager.getSentinels()) { org.redisson.client.RedisConnection connection = client.connect(); try { String res = connection.sync(RedisCommands.PING); if ("pong".equalsIgnoreCase(res)) { return new RedissonSentinelConnection(connection); } } catch (Exception e) { log.warn("Can't connect to " + client, e); connection.closeAsync(); } } throw new InvalidDataAccessResourceUsageException("Sentinels are not found"); }
@Override public RedisSentinelConnection getSentinelConnection() { if (!redisson.getConfig().isSentinelConfig()) { throw new InvalidDataAccessResourceUsageException("Redisson is not in Sentinel mode"); } SentinelConnectionManager manager = ((SentinelConnectionManager)((Redisson)redisson).getConnectionManager()); for (RedisClient client : manager.getSentinels()) { org.redisson.client.RedisConnection connection = client.connect(); try { String res = connection.sync(RedisCommands.PING); if ("pong".equalsIgnoreCase(res)) { return new RedissonSentinelConnection(connection); } } catch (Exception e) { log.warn("Can't connect to " + client, e); connection.closeAsync(); } } throw new InvalidDataAccessResourceUsageException("Sentinels are not found"); }
@Override public RedisSentinelConnection getSentinelConnection() { if (!redisson.getConfig().isSentinelConfig()) { throw new InvalidDataAccessResourceUsageException("Redisson is not in Sentinel mode"); } SentinelConnectionManager manager = ((SentinelConnectionManager)((Redisson)redisson).getConnectionManager()); for (RedisClient client : manager.getSentinels()) { org.redisson.client.RedisConnection connection = client.connect(); try { String res = connection.sync(RedisCommands.PING); if ("pong".equalsIgnoreCase(res)) { return new RedissonSentinelConnection(connection); } } catch (Exception e) { log.warn("Can't connect to " + client, e); connection.closeAsync(); } } throw new InvalidDataAccessResourceUsageException("Sentinels are not found"); }
@Override public RedisSentinelConnection getSentinelConnection() { if (!hasRedisSentinelConfigured()) { throw new InvalidDataAccessResourceUsageException("No sentinels configured."); } RedisNode node = selectActiveSentinel(); RedisSentinelConnection connection = connectionCache.get(node); if (connection == null || !connection.isOpen()) { connection = getSentinelConnection(node); connectionCache.putIfAbsent(node, connection); } return connection; }
@Override public RedisSentinelConnection getSentinelConnection() { if (!isRedisSentinelAware()) { throw new InvalidDataAccessResourceUsageException("No Sentinels configured"); } return new JedisSentinelConnection(getActiveSentinel()); }
throw new InvalidDataAccessResourceUsageException( "The getGeneratedKeys feature is not supported by this database");
private Jedis getActiveSentinel() { Assert.isTrue(RedisConfiguration.isSentinelConfiguration(configuration), "SentinelConfig must not be null!"); for (RedisNode node : ((SentinelConfiguration) configuration).getSentinels()) { Jedis jedis = new Jedis(node.getHost(), node.getPort(), getConnectTimeout(), getReadTimeout()); if (jedis.ping().equalsIgnoreCase("pong")) { potentiallySetClientName(jedis); return jedis; } } throw new InvalidDataAccessResourceUsageException("No Sentinel found"); }
return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
private Object[] getFieldsForUpdate(ClientDetails clientDetails, String zoneId) { Map<String, Object> additionalInformation = new HashMap(clientDetails.getAdditionalInformation()); Collection<String> requiredGroups = (Collection<String>) additionalInformation.remove(REQUIRED_USER_GROUPS); String json; try { json = JsonUtils.writeValueAsString(additionalInformation); } catch (Exception e) { logger.warn("Could not serialize additional information: " + clientDetails, e); throw new InvalidDataAccessResourceUsageException("Could not serialize additional information:"+clientDetails.getClientId(), e); } return new Object[] { collectionToString(clientDetails.getResourceIds()), collectionToString(clientDetails.getScope()), collectionToString(clientDetails.getAuthorizedGrantTypes()), collectionToString(clientDetails.getRegisteredRedirectUri()), collectionToString(clientDetails.getAuthorities()), clientDetails.getAccessTokenValiditySeconds(), clientDetails.getRefreshTokenValiditySeconds(), json, getAutoApproveScopes(clientDetails), new Timestamp(System.currentTimeMillis()), collectionToString(requiredGroups), clientDetails.getClientId(), zoneId }; }
return new InvalidDataAccessResourceUsageException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex); return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
return new InvalidDataAccessResourceUsageException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
return new InvalidDataAccessResourceUsageException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex); return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);