Package org.hibernate

Examples of org.hibernate.HibernateException


    if(dataSource != null)
    try {
      Method mClose = dataSource.getClass().getMethod("close", null);
      mClose.invoke(dataSource, null);
    } catch (Exception e) {
      throw new HibernateException(e);
    }
    dataSource = null;
  }
View Full Code Here


        value = StringUtils.replace(value, "{DLOG4J}", Globals.WEBAPP_PATH);
        new_props.setProperty(key.substring(BASE_KEY.length()), value);
      }
    }
    if(dataSourceClass == null)
      throw new HibernateException("Property 'dscp.datasource' no defined.");
    try {
      dataSource = (DataSource)Class.forName(dataSourceClass).newInstance();
      BeanUtils.populate(dataSource, new_props);
    } catch (Exception e) {
      throw new HibernateException(e);
    }
  }
View Full Code Here

        IndexWriter iw = new IndexWriter(directory,
            new StandardAnalyzer(), create);
        iw.close();
      }
    } catch (IOException e) {
      throw new HibernateException("Unable to initialize index: "
          + indexFile, e);
    }
    dp = new DynamicFSDirectoryProvider(indexName, localdp.getIndexProps(),
        localdp.getSearchFactoryImplementor());
    ReaderProvider rp = localdp.getSearchFactoryImplementor()
View Full Code Here

  public DynamicFSDirectoryProvider(String indexName,Properties indexProps, SearchFactoryImplementor searchFactoryImplementor){
    this.indexName=indexName;
    try {
      directory = FSDirectory.getDirectory( indexName );
    } catch (IOException e) {
      throw new HibernateException( "Unable to initialize index: " + indexName, e );
    }
    configureOptimizerStrategy(searchFactoryImplementor, indexProps, this);
    configureIndexingParameters(searchFactoryImplementor, indexProps, this);
    if ( !searchFactoryImplementor.getLockableDirectoryProviders().containsKey( this ) ) {
      searchFactoryImplementor.getLockableDirectoryProviders().put( this, new ReentrantLock() );
View Full Code Here

      }
      indexName = indexDir.getCanonicalPath();
      directory = FSDirectory.getDirectory( indexName );
    }
    catch (IOException e) {
      throw new HibernateException( "Unable to initialize index: " + directoryProviderName, e );
    }

  }
View Full Code Here

      }
      Loader loader = getLoader( sess, searchFactoryImplementor );
      return new IteratorImpl( infos, loader );
    }
    catch (IOException e) {
      throw new HibernateException( "Unable to query Lucene index", e );
    }
    finally {
      try {
        searchFactoryImplementor.getReaderProvider().closeReader( searcher.getIndexReader() );
      }
View Full Code Here

        searchFactory.getReaderProvider().closeReader( searcher.getIndexReader() );
      }
      catch (SearchException ee) {
        //we have the initial issue already
      }
      throw new HibernateException( "Unable to query Lucene index", e );
    }
  }
View Full Code Here

      else {
        return resultTransformer.transformList( list );
      }
    }
    catch (IOException e) {
      throw new HibernateException( "Unable to query Lucene index", e );
    }
    finally {
      try {
        searchFactoryImplementor.getReaderProvider().closeReader( searcher.getIndexReader() );
      }
View Full Code Here

      }
      for (Class clazz : involvedClasses) {
        DocumentBuilder builder = builders.get( clazz );
        //TODO should we rather choose a polymorphic path and allow non mapped entities
        if ( builder == null )
          throw new HibernateException( "Not a mapped entity (don't forget to add @Indexed): " + clazz );

//        final DirectoryProvider[] directoryProviders =
//            builder.getDirectoryProviderSelectionStrategy().getDirectoryProvidersForAllShards();
       
        //changed by jerry
View Full Code Here

        try {
          hits = getHits( searcher );
          resultSize = hits.length();
        }
        catch (IOException e) {
          throw new HibernateException( "Unable to query Lucene index", e );
        }
        finally {
          //searcher cannot be null
          try {
            searchFactoryImplementor.getReaderProvider().closeReader( searcher.getIndexReader() );
View Full Code Here

TOP

Related Classes of org.hibernate.HibernateException

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.