Package org.infinispan.persistence

Examples of org.infinispan.persistence.CacheLoaderException


         if (log.isTraceEnabled()) {
            log.tracef("Successfully inserted %d buckets into the database, batch size is %d", readCount, batchSize);
         }
      } catch (IOException ex) {
         log.ioErrorIntegratingState(ex);
         throw new CacheLoaderException("I/O failure while integrating state into store", ex);
      } catch (SQLException e) {
         log.sqlFailureIntegratingState(e);
         throw new CacheLoaderException("SQL failure while integrating state into store", e);
      } catch (ClassNotFoundException e) {
         log.classNotFoundIntegratingState(e);
         throw new CacheLoaderException("Unexpected failure while integrating state into store", e);
      } catch (InterruptedException ie) {
         if (log.isTraceEnabled()) log.trace("Interrupted while reading from stream");
         Thread.currentThread().interrupt();
      } finally {
         JdbcUtil.safeClose(ps);
View Full Code Here


            toStreamProcess(rs, is, objectOutput);
         }
         marshaller.objectToObjectStream(streamDelimiter, objectOutput);
      } catch (SQLException e) {
         log.sqlFailureStoringKeys(e);
         throw new CacheLoaderException("SQL Error while storing string keys to database", e);
      } catch (IOException e) {
         log.ioErrorStoringKeys(e);
         throw new CacheLoaderException("I/O Error while storing string keys to database", e);
      }
      finally {
         JdbcUtil.safeClose(rs);
         JdbcUtil.safeClose(ps);
         connectionFactory.releaseConnection(connection);
View Full Code Here

            loadAllProcess(rs, result);
         }
         return result;
      } catch (SQLException e) {
         log.sqlFailureFetchingAllStoredEntries(e);
         throw new CacheLoaderException("SQL error while fetching all StoredEntries", e);
      } finally {
         JdbcUtil.safeClose(rs);
         JdbcUtil.safeClose(ps);
         connectionFactory.releaseConnection(conn);
      }
View Full Code Here

            loadAllKeysProcess(rs, result, keysToExclude);
         }
         return result;
      } catch (SQLException e) {
         log.sqlFailureFetchingAllStoredEntries(e);
         throw new CacheLoaderException("SQL error while fetching all StoredEntries", e);
      } finally {
         JdbcUtil.safeClose(rs);
         JdbcUtil.safeClose(ps);
         connectionFactory.releaseConnection(conn);
      }
View Full Code Here

            loadAllProcess(rs, result, maxEntries);
         }
         return result;
      } catch (SQLException e) {
         log.sqlFailureFetchingAllStoredEntries(e);
         throw new CacheLoaderException("SQL error while fetching all StoredEntries", e);
      } finally {
         JdbcUtil.safeClose(rs);
         JdbcUtil.safeClose(ps);
         connectionFactory.releaseConnection(conn);
      }
View Full Code Here

      SimpleConnectionFactoryConfiguration factoryConfiguration;
      if (config instanceof SimpleConnectionFactoryConfiguration) {
         factoryConfiguration = (SimpleConnectionFactoryConfiguration) config;
      }
      else {
         throw new CacheLoaderException("ConnectionFactoryConfiguration has to be an instance of " +
               "SimpleConnectionFactoryConfiguration.");
      }

      loadDriver(factoryConfiguration.driverClass(), classLoader);
      this.connectionUrl = factoryConfiguration.connectionUrl();
View Full Code Here

   @Override
   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!");
         connectionCount++;
         return connection;
      } catch (SQLException e) {
         throw new CacheLoaderException("Could not obtain a new connection", e);
      }
   }
View Full Code Here

   public static ByteBuffer marshall(StreamingMarshaller marshaller, Object obj) throws CacheLoaderException, InterruptedException {
      try {
         return marshaller.objectToBuffer(obj);
      } catch (IOException e) {
         log.errorMarshallingObject(e, obj);
         throw new CacheLoaderException("I/O failure while marshalling object: " + obj, e);
      }
   }
View Full Code Here

   public static <T> T unmarshall(StreamingMarshaller marshaller, InputStream inputStream) throws CacheLoaderException {
      try {
         return (T) marshaller.objectFromInputStream(inputStream);
      } catch (IOException e) {
         log.ioErrorUnmarshalling(e);
         throw new CacheLoaderException("I/O error while unmarshalling from stream", e);
      } catch (ClassNotFoundException e) {
         log.unexpectedClassNotFoundException(e);
         throw new CacheLoaderException("*UNEXPECTED* ClassNotFoundException. This should not happen as Bucket class exists", e);
      }
   }
View Full Code Here

         ManagedConnectionFactoryConfiguration managedConfiguration = (ManagedConnectionFactoryConfiguration)
               factoryConfiguration;
         datasourceName = managedConfiguration.jndiUrl();
      }
      else {
         throw new CacheLoaderException("FactoryConfiguration has to be an instance of " +
               "ManagedConnectionFactoryConfiguration");
      }
      try {
         ctx = new InitialContext();
         dataSource = (DataSource) ctx.lookup(datasourceName);
         if (trace) {
            log.tracef("Datasource lookup for %s succeeded: %b", datasourceName, dataSource);
         }
         if (dataSource == null) {
            log.connectionInJndiNotFound(datasourceName);
            throw new CacheLoaderException(String.format(
                  "Could not find a connection in jndi under the name '%s'", datasourceName));
         }
      }
      catch (NamingException e) {
         log.namingExceptionLookingUpConnection(datasourceName, e);
         throw new CacheLoaderException(e);
      }
      finally {
         if (ctx != null) {
            try {
               ctx.close();
View Full Code Here

TOP

Related Classes of org.infinispan.persistence.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.