-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Mass Indexer with c3P0 connection provider.
PostPosted: Fri Feb 11, 2011 10:23 am 
Beginner
Beginner

Joined: Tue Sep 28, 2010 5:14 am
Posts: 25
Hi,

I am using MassIndexer for indexing. While the massindexer works fine with hibernate's default connection provider, when I move to C3P0 connection provider, the application acquire's a lock on index file but does nothing. The application doesn't throw any excpetion either. The request just wait for a long time and I dont see anything happening, its more like a thread having acquired lock but doing nothing on it. Any idea what would be possible prob ?

Code:
FullTextSession ftSession = SessionUtil.getFullTextSessionInstance();
      
      ftSession.getTransaction().begin();
      try {
         
         ftSession.createIndexer(Employee.class)
         .batchSizeToLoadObjects(100)
         .cacheMode(CacheMode.IGNORE)
         .threadsToLoadObjects(10)
         .threadsForSubsequentFetching(25)
         .startAndWait();
         
      } catch (InterruptedException e) {
         e.printStackTrace();
         log.error("InterruptedException in "+CLASS_NAME+":indexRecord() >>", e);
      }



Configuration Fields

Code:
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
         <property name="hibernate.connection.url">jdbc:oracle:thin:@test:1522:Domain</property>
         <property name="hibernate.connection.username">test</property>
         <property name="hibernate.connection.password">pwd</property>
         <property name="hibernate.connection.pool_size">10</property>
         <property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
         <property name="c3p0.acquire_increment">1</property>
         <property name="c3p0.idle_test_period">100</property>
         <property name="c3p0.max_size">10</property>
         <property name="c3p0.max_statements">0</property>
         <property name="c3p0.min_size">5</property>
         <property name="c3p0.timeout">1800</property>
       
         
              <property name="current_session_context_class">thread</property>       
              <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
         <property name="show_sql">true</property>
         <property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>
         <property name="hibernate.hbm2ddl.auto">update</property>
        
            

         <!-- Hibernate search configuration  -->
         <property name="hibernate.search.default.directory_provider">org.hibernate.search.store.FSDirectoryProvider</property>
         <property name="hibernate.search.default.indexName">Index</property>
         <property name="hibernate.search.default.indexBase">/indexes</property>
         <property name="hibernate.search.default.batch.merge_factor">10</property>
         <property name="hibernate.search.default.batch.max_buffered_docs">10</property>


Top
 Profile  
 
 Post subject: Re: Mass Indexer with c3P0 connection provider.
PostPosted: Fri Feb 11, 2011 1:11 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Did you check the logs? Have you enabled debug logging?


Top
 Profile  
 
 Post subject: Re: Mass Indexer with c3P0 connection provider.
PostPosted: Sun Feb 13, 2011 7:23 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
You're asking him to use 25 threads for subsequent fetching, plus 10 to load the objects, 1 is implicit to load the identifiers = total 36 open Sessions needed at the same time.
But you've limited c3p0 to not open more than 10 connections at the same time, so it's basically waiting for more connections to be available, but c3p0 will never give more than 10; unfortunately Hibernate can't warn you about this as it has no control/knowledge on the connection provider - you have to do the math and either raise the number of connections to at least 40, or lower the number of threads used during massindexing.

I'll see if we can add an additional thread monitoring for this, but I don't think it can actually recover. Please see, comment and provide suggestions/patches on:HSEARCH-598

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Mass Indexer with c3P0 connection provider.
PostPosted: Mon Jul 14, 2014 2:48 am 
Newbie

Joined: Fri Jul 11, 2014 4:42 am
Posts: 2
I am facing the same problem https://forum.hibernate.org/viewtopic.php?f=9&t=1035246. In this I am using default configurations of startAndWait(). BoneCp with bonecp.maxConnectionsPerPartition value of 25. I monitored number for active connections It doesn't exceed 10 it means still more connections are available but what is the problem ?????


Top
 Profile  
 
 Post subject: Re: Mass Indexer with c3P0 connection provider.
PostPosted: Mon Jul 14, 2014 6:17 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Which version? this problem was resolved in version 4.5.x so I suspect it's not related to limits on the connection anymore.
Are you sure it's not just working? Please share a threaddump and exact version numbers, we can try see from there where it is stuck.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.