|
[
Permlink
| « Hide
]
Shay Banon added a comment - 10/Jun/08 05:30 PM
Compass releases connections acquired by the datasource. It only acquires them when performing operations and then releases them. Should that be enough, or do you see a bug there?
I just looked through the Compass code, and it does appear that Compass releases connections like I expected it to.
I'm getting exceptions from other parts of my application indicating that there are no connections available in the connection pool. Upon further investigation, it appears that this is because Compass is using them (even though no searches are going on at the time). It appears to be related to Compass's scheduled tasks, but that's all the information I have at this point. I will continue to look into the issue on my end and report back when I know more. In the meantime, if you have any tips on where I should be looking, I'd appreciate it. There isn't a lot of work done concurrently by Compass in a scheduled manner. There is the optimizer, which might cause that, I am not sure though. Maybe try and understand from which scheduled task this happens (breakpoint?)?
Sorry for not helping more... . Hi folks,
I've seen this issue myself with mysql where database connections aren't getting released. I took Shay's advice and when I comment out the optimizer the problem goes away. Something in the optimizer must cause it as a problem. My spring configuration is below: <!-- database storage of index --> <bean id="compass" class="org.compass.spring.LocalCompassBean"> <property name="classMappings"> <list> <value>com.bm.model.Address</value> <value>com.bm.model.Region</value> <value>com.bm.model.Category</value> </list> </property> <property name="transactionManager" ref="transactionManager" /> <property name="compassConfiguration" ref="annotationConfiguration" /> <property name="compassSettings"> <props> <prop key="compass.engine.connection">jdbc://jdbc:mysql://localhost/lportal?relaxAutoCommit=true&useUnicode=true&characterEncoding=UTF-8&emulateLocators=true</prop> <!-- Optimizer settings <prop key="compass.engine.optimizer.schedule">false</prop> <prop key="compass.engine.optimizer.type">org.compass.core.lucene.engine.optimizer.AdaptiveOptimizer</prop> <prop key="compass.engine.optimizer.adptive.mergeFactor">4</prop> <prop key="compass.engine.optimizer.schedule.period">10</prop> <prop key="compass.engine.optimizer.schedule.daemon">true</prop> <prop key="compass.engine.optimizer.schedule.fixedRate">false</prop> End Optimizer settings --> <!-- Use non compound index format when using JDBC Directory --> <prop key="compass.engine.useCompoundFile">false</prop> <!-- Customize locking mechanism to handle PhantomRead exceptions: interval is in millis and timeout is in seconds --> <prop key="compass.transaction.lockPollInterval">200</prop> <prop key="compass.transaction.lockTimeout">30</prop> <!-- turn it off --> <prop key="compass.engine.cacheIntervalInvalidation">-1</prop> <!-- By Default, compass uses StandardAnalyzer for indexing and searching. StandardAnalyzer will use certain stop words (stop words are not indexed and hence not searcheable) which are valid search terms in the DataSource World. So we need to provide our won Analyzer. --> <prop key="compass.engine.analyzer.default.type">snowball</prop> <prop key="compass.engine.analyzer.default.name">English</prop> <!-- start transactions --> <prop key="compass.transaction.factory">org.compass.spring.transaction.SpringSyncTransactionFactory</prop> <prop key="compass.transaction.isolation">read_committed</prop> <prop key="compass.transaction.commitBeforeCompletion">true</prop> <!-- end transactions --> </props> </property> <property name="dataSource" ref="dataSource" /> </bean> |