diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2010-04-07 03:15:42 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2010-04-07 03:15:42 +0000 |
commit | e94abeff3ac54459388f698608f0b10334463229 (patch) | |
tree | 36ee50abc71aaa167be98911661b3bfa2d9a63df | |
parent | a262448505c7975f73db190e65707cdb683c18b3 (diff) | |
download | jackcess-e94abeff3ac54459388f698608f0b10334463229.tar.gz jackcess-e94abeff3ac54459388f698608f0b10334463229.zip |
enable big index support by default
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@460 f203690c-595d-4dc9-a70b-905162fa7fd2
-rw-r--r-- | src/java/com/healthmarketscience/jackcess/Database.java | 31 | ||||
-rw-r--r-- | src/java/com/healthmarketscience/jackcess/Table.java | 4 | ||||
-rw-r--r-- | src/site/fml/faq.fml | 7 |
3 files changed, 25 insertions, 17 deletions
diff --git a/src/java/com/healthmarketscience/jackcess/Database.java b/src/java/com/healthmarketscience/jackcess/Database.java index 73a8514..5dadac1 100644 --- a/src/java/com/healthmarketscience/jackcess/Database.java +++ b/src/java/com/healthmarketscience/jackcess/Database.java @@ -62,14 +62,14 @@ import org.apache.commons.logging.LogFactory; /** * An Access database. * <p> - * There is now experimental, optional support for large indexes (disabled by - * default). This optional support can be enabled via a few different means: + * There is optional support for large indexes (enabled by default). This + * optional support can be disabled via a few different means: * <ul> * <li>Setting the system property {@value #USE_BIG_INDEX_PROPERTY} to - * {@code "true"} will enable "large" index support accross the jvm</li> - * <li>Calling {@link #setUseBigIndex} with {@code true} on a Database - * instance will enable "large" index support for all tables subsequently - * created from that instance</li> + * {@code "false"} will disable "large" index support across the jvm</li> + * <li>Calling {@link #setUseBigIndex} on a Database instance will override + * any system property setting for "large" index support for all tables + * subsequently created from that instance</li> * <li>Calling {@link #getTable(String,boolean)} can selectively * enable/disable "large" index support on a per-table basis (overriding * any Database or system property setting)</li> @@ -295,8 +295,8 @@ public class Database private Table _queries; /** SIDs to use for the ACEs added for new tables */ private final List<byte[]> _newTableSIDs = new ArrayList<byte[]>(); - /** for now, "big index support" is optional */ - private boolean _useBigIndex; + /** "big index support" is optional, but enabled by default */ + private Boolean _useBigIndex; /** optional error handler to use when row errors are encountered */ private ErrorHandler _dbErrorHandler; /** the file format of the database */ @@ -513,7 +513,7 @@ public class Database * Whether or not big index support is enabled for tables. */ public boolean doUseBigIndex() { - return _useBigIndex; + return (_useBigIndex != null ? _useBigIndex : true); } /** @@ -1227,11 +1227,18 @@ public class Database } /** - * Returns {@code true} if "big index support" has been enabled explicity on - * the this Database or via a system property, {@code false} otherwise. + * Returns {@code false} if "big index support" has been disabled explicity + * on the this Database or via a system property, {@code true} otherwise. */ public boolean defaultUseBigIndex() { - return doUseBigIndex() || Boolean.getBoolean(USE_BIG_INDEX_PROPERTY); + if(_useBigIndex != null) { + return _useBigIndex; + } + String prop = System.getProperty(USE_BIG_INDEX_PROPERTY); + if(prop != null) { + return Boolean.TRUE.toString().equalsIgnoreCase(prop); + } + return true; } /** diff --git a/src/java/com/healthmarketscience/jackcess/Table.java b/src/java/com/healthmarketscience/jackcess/Table.java index 02f1d49..ebed2e3 100644 --- a/src/java/com/healthmarketscience/jackcess/Table.java +++ b/src/java/com/healthmarketscience/jackcess/Table.java @@ -125,7 +125,7 @@ public class Table /** page buffer used to write out-of-line "long value" data */ private final TempPageHolder _longValueBufferH = TempPageHolder.newHolder(TempBufferHolder.Type.SOFT); - /** for now, "big index support" is optional */ + /** "big index support" is optional */ private final boolean _useBigIndex; /** optional error handler to use when row errors are encountered */ private ErrorHandler _tableErrorHandler; @@ -144,7 +144,7 @@ public class Table _database = null; _tableDefPageNumber = PageChannel.INVALID_PAGE_NUMBER; _name = null; - _useBigIndex = false; + _useBigIndex = true; setColumns(columns); } diff --git a/src/site/fml/faq.fml b/src/site/fml/faq.fml index f342349..059eba3 100644 --- a/src/site/fml/faq.fml +++ b/src/site/fml/faq.fml @@ -203,9 +203,10 @@ of rows. When the index size limit was reached an UnsupportedOperationException (or possibly an IOException) was thrown. As of the 1.1.14 release, experimental, optional large index support - has been added. This support is disabled by default but can be - enabled via a few different means. Please see the <a href="apidocs/com/healthmarketscience/jackcess/Database.html">Database javadocs</a> - for details on enabling large index support. + has been added. As of the 1.2.0 release, large index support is + enabled by default. This support is enabled/disabled via a few + different means. Please see the <a href="apidocs/com/healthmarketscience/jackcess/Database.html">Database + javadocs</a> for details on enabling/disabling large index support. </answer> </faq> |