Author: sannegrinovero
Date: 2008-11-17 08:37:10 -0500 (Mon, 17 Nov 2008)
New Revision: 15579
Modified:
search/trunk/src/java/org/hibernate/search/backend/LuceneIndexingParameters.java
search/trunk/src/test/org/hibernate/search/test/configuration/LuceneIndexingParametersTest.java
Log:
HSEARCH-298 just warn instead of exceptions when transaction.use_compound_file !=
batch.use_compound_file
Modified:
search/trunk/src/java/org/hibernate/search/backend/LuceneIndexingParameters.java
===================================================================
---
search/trunk/src/java/org/hibernate/search/backend/LuceneIndexingParameters.java 2008-11-17
13:23:56 UTC (rev 15578)
+++
search/trunk/src/java/org/hibernate/search/backend/LuceneIndexingParameters.java 2008-11-17
13:37:10 UTC (rev 15579)
@@ -60,13 +60,13 @@
log.warn( "The max_field_length value configured for transaction is "
+ "different than the value configured for batch." );
}
+ Integer useCompoundTransaction = transParams.parameters.get( USE_COMPOUND_FILE );
+ Integer useCompoundBatch = batchParams.parameters.get( USE_COMPOUND_FILE );
+ if ( notEquals( useCompoundTransaction, useCompoundBatch ) ) {
+ log.warn( "The IndexWriter setting \"use_compound_file\" for batch
"+
+ "mode can't be different from the transaction setting." );
+ }
}
- Integer useCompoundTransaction = transParams.parameters.get( USE_COMPOUND_FILE );
- Integer useCompoundBatch = batchParams.parameters.get( USE_COMPOUND_FILE );
- if ( notEquals( useCompoundTransaction, useCompoundBatch ) ) {
- throw new SearchException( "The IndexWriter setting
\"use_compound_file\" for batch "+
- "mode can't be different from the transaction setting." );
- }
}
private boolean notEquals(Integer a, Integer b) {
Modified:
search/trunk/src/test/org/hibernate/search/test/configuration/LuceneIndexingParametersTest.java
===================================================================
---
search/trunk/src/test/org/hibernate/search/test/configuration/LuceneIndexingParametersTest.java 2008-11-17
13:23:56 UTC (rev 15578)
+++
search/trunk/src/test/org/hibernate/search/test/configuration/LuceneIndexingParametersTest.java 2008-11-17
13:37:10 UTC (rev 15579)
@@ -4,7 +4,6 @@
import java.io.IOException;
import java.util.Properties;
-import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.search.backend.LuceneIndexingParameters;
import org.hibernate.search.test.Document;
import org.hibernate.search.test.SerializationTestHelper;
@@ -29,7 +28,8 @@
super.configure( cfg );
cfg.setProperty( "hibernate.search.default.batch.ram_buffer_size",
"1" );
- cfg.setProperty( "hibernate.search.default.transaction.use_compound_file",
"true" );
+ cfg.setProperty( "hibernate.search.default.transaction.use_compound_file",
"false" );
+ cfg.setProperty( "hibernate.search.default.batch.use_compound_file",
"true" ); //should see a warning about this
//set by super : cfg.setProperty(
"hibernate.search.default.batch.max_buffered_docs", "1000" );
cfg.setProperty( "hibernate.search.default.transaction.ram_buffer_size",
"2" );
@@ -114,13 +114,6 @@
assertEquals( param.getTransactionIndexParameters(),
paramCopy.getTransactionIndexParameters() );
}
- public void testInvalidConfiguration() {
- AnnotationConfiguration configuration = new AnnotationConfiguration();
- configuration.setProperty(
"hibernate.search.default.transaction.use_compound_file", "true" );
- configuration.setProperty(
"hibernate.search.default.batch.use_compound_file", "false" );
- assertCfgIsInvalid( configuration, getMappings() );
- }
-
protected Class[] getMappings() {
return new Class[] {
Book.class,
Show replies by date