-->
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.  [ 2 posts ] 
Author Message
 Post subject: Indexing and database connections
PostPosted: Thu Nov 10, 2011 10:12 am 
Newbie

Joined: Tue Jul 26, 2011 6:46 pm
Posts: 11
Hi,

I have over 20 classes in my app which I want to index. I am testing my application both on Unix and Windows. I am using PostGres DB and c3p0 for connection pooling. There are few problems that I face while indexing.

When I keep maximum allowed connections to 100, Postgres cries "Too many clients". When I reduce it to 25 or so, indexer just hangs at some random place for a long time. ("Too many clients" issue is what I have faced on Windows but I have not tested it on Unix yet. Hanging issue is seen on both)

I have few questions regarding this.

1. Is there any specific formula to know how many connections are proper for the Indexer to run.
2. Is there a proper way to resolve the above issues.

Also I thought as I am facing issues while indexing more classes and it runs fine for a couple of classes, I thought of having a work around and that is to index these classes one by one. So my question regarding to this is, is there any difference between following two pieces of codes? Will there be a difference in the way the indexes are created?

Approach 1:

Code:
Session session = HibUtil.getSessionFactory().openSession();
      FullTextSession fullTextSession = Search.getFullTextSession(session);
      try {
         fullTextSession.createIndexer(Employee.class,Department.class,Adress.class).startAndWait();
      } catch (InterruptedException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
      }


Approach 2:

Code:
Session session = HibUtil.getSessionFactory().openSession();
      FullTextSession fullTextSession = Search.getFullTextSession(session);
      Class[] klass={Employee.class,Department.class,Adress.class};
      for(Class k:klass){
         try {
            fullTextSession.createIndexer(k).startAndWait();
         } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
         }
      }


Top
 Profile  
 
 Post subject: Re: Indexing and database connections
PostPosted: Thu Jul 12, 2012 8:22 am 
Newbie

Joined: Thu Jul 12, 2012 8:11 am
Posts: 1
Did you find any solution?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.