Package org.infinispan.loader

Examples of org.infinispan.loader.CacheLoaderException


      try {
         statement = conn.createStatement();
         statement.executeUpdate(sql);
      } catch (SQLException e) {
         log.error("Error while creating table", e);
         throw new CacheLoaderException(e);
      } finally {
         JdbcUtil.safeClose(statement);
      }
   }
View Full Code Here


      try {
         pooledDataSource.setDriverClass(config.getDriverClass()); //loads the jdbc driver
      } catch (PropertyVetoException e) {
         String message = "Error while instatianting JDBC driver: '" + config.getDriverClass();
         log.error(message, e);
         throw new CacheLoaderException(message, e);
      }
      pooledDataSource.setJdbcUrl(config.getConnectionUrl());
      pooledDataSource.setUser(config.getUserName());
      pooledDataSource.setPassword(config.getPassword());
   }
View Full Code Here

            log.trace("DataSource after checkout (NumConnectionsAllUsers) : " + pooledDataSource.getNumConnectionsAllUsers());
            log.trace("Connection checked out: " + connection);
         }
         return connection;
      } catch (SQLException e) {
         throw new CacheLoaderException("Failed obtaining connection from PooledDataSource", e);
      }
   }
View Full Code Here

   public Connection getConnection() throws CacheLoaderException {
      try {
         Connection connection = DriverManager.getConnection(connectionUrl, userName, password);
         if (connection == null)
            throw new CacheLoaderException("Received null connection from the DriverManager!");
         return connection;
      } catch (SQLException e) {
         throw new CacheLoaderException("Could not obtain a new connection", e);
      }
   }
View Full Code Here

         Class.forName(driverClass).newInstance();
      }
      catch (Throwable th) {
         String message = "Failed loading driver with class: '" + driverClass + "'";
         log.error(message, th);
         throw new CacheLoaderException(message, th);
      }
   }
View Full Code Here

         ps.setBinaryStream(1, byteBuffer.getStream(), byteBuffer.getLength());
         ps.setLong(2, bucket.timestampOfFirstEntryToExpire());
         ps.setString(3, bucket.getBucketName());
         int insertedRows = ps.executeUpdate();
         if (insertedRows != 1) {
            throw new CacheLoaderException("Unexpected insert result: '" + insertedRows + "'. Expected values is 1");
         }
      } catch (SQLException ex) {
         logAndThrow(ex, "sql failure while inserting bucket: " + bucket);
      } finally {
         JdbcUtil.safeClose(ps);
View Full Code Here

    */
   public static ConnectionFactory getConnectionFactory(String connectionFactoryClass) throws CacheLoaderException {
      try {
         return (ConnectionFactory) Util.getInstance(connectionFactoryClass);
      } catch (Exception e) {
         throw new CacheLoaderException(e);
      }
   }
View Full Code Here

         ps.setBinaryStream(1, buffer.getStream(), buffer.getLength());
         ps.setLong(2, bucket.timestampOfFirstEntryToExpire());
         ps.setString(3, bucket.getBucketName());
         int updatedRows = ps.executeUpdate();
         if (updatedRows != 1) {
            throw new CacheLoaderException("Unexpected  update result: '" + updatedRows + "'. Expected values is 1");
         }
      } catch (SQLException e) {
         logAndThrow(e, "sql failure while updating bucket: " + bucket);
      } finally {
         JdbcUtil.safeClose(ps);
View Full Code Here

         bucket.setBucketName(bucketName);//bucket name is volatile, so not persisted.
         return bucket;
      } catch (SQLException e) {
         String message = "sql failure while loading key: " + keyHashCode;
         log.error(message, e);
         throw new CacheLoaderException(message, e);
      } finally {
         JdbcUtil.safeClose(rs);
         JdbcUtil.safeClose(ps);
         connectionFactory.releaseConnection(conn);
      }
View Full Code Here

         }
         return result;
      } catch (SQLException e) {
         String message = "sql failure while loading key: ";
         log.error(message, e);
         throw new CacheLoaderException(message, e);
      } finally {
         JdbcUtil.safeClose(rs);
         JdbcUtil.safeClose(ps);
         connectionFactory.releaseConnection(conn);
      }
View Full Code Here

TOP

Related Classes of org.infinispan.loader.CacheLoaderException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.