提交 c5b9c3e0 authored 作者: Thomas Mueller's avatar Thomas Mueller

Spellchecking, javadocs, formatting

上级 a9d41543
...@@ -30,8 +30,6 @@ MVStore ...@@ -30,8 +30,6 @@ MVStore
Building the MVStore Library</a><br /> Building the MVStore Library</a><br />
<a href="#requirements"> <a href="#requirements">
Requirements</a><br /> Requirements</a><br />
<a href="#future_plans">
Future Plans</a><br />
<h2 id="overview">Overview</h2> <h2 id="overview">Overview</h2>
<p> <p>
...@@ -61,7 +59,7 @@ open a map, add some data, and access the current and an old version. ...@@ -61,7 +59,7 @@ open a map, add some data, and access the current and an old version.
MVStore s = MVStore.open(fileName); MVStore s = MVStore.open(fileName);
// create/get the map named "data" // create/get the map named "data"
MVMap<Integer, String> map = s.openMap("data"); MVMap&lt;Integer, String&gt; map = s.openMap("data");
// add some data // add some data
map.put(1, "Hello"); map.put(1, "Hello");
...@@ -80,7 +78,7 @@ map.put(1, "Hi"); ...@@ -80,7 +78,7 @@ map.put(1, "Hi");
map.remove(2); map.remove(2);
// access the old data (before incrementVersion) // access the old data (before incrementVersion)
MVMap<Integer, String> oldMap = MVMap&lt;Integer, String&gt; oldMap =
map.openVersion(oldVersion); map.openVersion(oldVersion);
// store the newest data to disk // store the newest data to disk
...@@ -124,7 +122,7 @@ MVStore s = MVStore.open(null); ...@@ -124,7 +122,7 @@ MVStore s = MVStore.open(null);
// create an R-tree map // create an R-tree map
// the key has 2 dimensions, the value is a string // the key has 2 dimensions, the value is a string
MVRTreeMap<String> r = MVRTreeMap.create(2, new ObjectType()); MVRTreeMap&lt;String&gt; r = MVRTreeMap.create(2, new ObjectType());
// open the map // open the map
r = s.openMap("data", r); r = s.openMap("data", r);
...@@ -136,7 +134,7 @@ r.add(new SpatialKey(0, -3f, -2f, 2f, 3f), "left"); ...@@ -136,7 +134,7 @@ r.add(new SpatialKey(0, -3f, -2f, 2f, 3f), "left");
r.add(new SpatialKey(1, 3f, 4f, 4f, 5f), "right"); r.add(new SpatialKey(1, 3f, 4f, 4f, 5f), "right");
// iterate over the intersecting keys // iterate over the intersecting keys
Iterator<SpatialKey> it = Iterator&lt;SpatialKey&gt; it =
r.findIntersectingKeys(new SpatialKey(0, 0f, 9f, 3f, 6f)); r.findIntersectingKeys(new SpatialKey(0, 0f, 9f, 3f, 6f));
for (SpatialKey k; it.hasNext();) { for (SpatialKey k; it.hasNext();) {
k = it.next(); k = it.next();
......
...@@ -1634,462 +1634,501 @@ Change Log ...@@ -1634,462 +1634,501 @@ Change Log
Next Version (unreleased) Next Version (unreleased)
@changelog_1002_li @changelog_1002_li
PostgreSQL compatibility: support for EXTRACT(WEEK FROM dateColumn). Thanks to Prashant Bhat for the patch! Issue 407: The TriggerAdapter didn't work with CLOB and BLOB columns.
@changelog_1003_li @changelog_1003_li
PostgreSQL compatibility: support for data types BIGSERIAL and SERIAL as an alias for AUTO_INCREMENT.
@changelog_1004_li
Issue 417: H2 Console: the web session timeout didn't work, resulting in a memory leak. This was only a problem if the H2 Console was run for a long time and many sessions were opened.
@changelog_1005_li
Issue 412: Running the Server tool with just the option "-browser" will now log a warning.
@changelog_1006_li
Issue 411: CloseWatcher registration was not concurrency-safe.
@changelog_1007_li
MySQL compatibility: support for CONCAT_WS. Thanks a lot to litailang for the patch!
@changelog_1008_li
PostgreSQL compatibility: support for EXTRACT(WEEK FROM dateColumn). Thanks to Prashant Bhat for the patch!
@changelog_1009_li
Fix for a bug where we would sometimes use the wrong unique constraint to validate foreign key constraints. Fix for a bug where we would sometimes use the wrong unique constraint to validate foreign key constraints.
@changelog_1004_h2 @changelog_1010_li
Support BOM at the beginning of files for the RUNSCRIPT command
@changelog_1011_li
Fix in calling SET @X = IDENTITY() where it would return NULL incorrectly
@changelog_1012_li
Fix ABBA deadlock between adding a constraint and the H2-Log-Writer thread.
@changelog_1013_li
Optimize IN(...) queries where the values are constant and of the same type.
@changelog_1014_li
Restore tool: the parameter "quiet" was not used and is now removed.
@changelog_1015_li
Fix ConcurrentModificationException when creating tables and executing SHOW TABLES in parallel. Reported by Viktor Voytovych.
@changelog_1016_li
Serialization is now pluggable using the system property "h2.javaObjectSerializer". Thanks to Sergi Vladykin for the patch!
@changelog_1017_h2
Version 1.3.169 (2012-09-09) Version 1.3.169 (2012-09-09)
@changelog_1005_li @changelog_1018_li
The default jar file is now compiled for Java 6. The default jar file is now compiled for Java 6.
@changelog_1006_li @changelog_1019_li
The new jar file will probably not end up in the central Maven repository in the next few weeks because Sonatype has disabled automatic synchronization from SourceForge (which they call 'legacy sync' now). It will probably take some time until this is sorted out. The H2 jar files are deployed to http://h2database.com/m2-repo/com/h2database/h2/maven-metadata.xml and http://hsql.sourceforge.net/m2-repo/com/h2database/h2/maven-metadata.xml as usual. The new jar file will probably not end up in the central Maven repository in the next few weeks because Sonatype has disabled automatic synchronization from SourceForge (which they call 'legacy sync' now). It will probably take some time until this is sorted out. The H2 jar files are deployed to http://h2database.com/m2-repo/com/h2database/h2/maven-metadata.xml and http://hsql.sourceforge.net/m2-repo/com/h2database/h2/maven-metadata.xml as usual.
@changelog_1007_li @changelog_1020_li
A part of the documentation and the H2 Console has been changed to support the Apple retina display. A part of the documentation and the H2 Console has been changed to support the Apple retina display.
@changelog_1008_li @changelog_1021_li
The CreateCluster tool could not be used if the source database contained a CLOB or BLOB. The root cause was that the TCP server did not synchronize on the session, which caused a problem when using the exclusive mode. The CreateCluster tool could not be used if the source database contained a CLOB or BLOB. The root cause was that the TCP server did not synchronize on the session, which caused a problem when using the exclusive mode.
@changelog_1009_li @changelog_1022_li
Statement.getQueryTimeout(): only the first call to this method will query the database. If the query timeout was changed in another way than calling setQueryTimeout, this method will always return the last value. This was changed because Hibernate calls getQueryTimeout() a lot. Statement.getQueryTimeout(): only the first call to this method will query the database. If the query timeout was changed in another way than calling setQueryTimeout, this method will always return the last value. This was changed because Hibernate calls getQueryTimeout() a lot.
@changelog_1010_li @changelog_1023_li
Issue 416: PreparedStatement.setNString throws AbstractMethodError. All implemented JDBC 4 methods that don't break compatibility with Java 5 are now included in the default jar file. Issue 416: PreparedStatement.setNString throws AbstractMethodError. All implemented JDBC 4 methods that don't break compatibility with Java 5 are now included in the default jar file.
@changelog_1011_li @changelog_1024_li
Issue 414: for some functions, the parameters were evaluated twice (for example "char(nextval(..))" ran "nextval(..)" twice). Issue 414: for some functions, the parameters were evaluated twice (for example "char(nextval(..))" ran "nextval(..)" twice).
@changelog_1012_li @changelog_1025_li
The ResultSetMetaData methods getSchemaName and getTableName could return null instead of "" (an empty string) as specified in the JDBC API. The ResultSetMetaData methods getSchemaName and getTableName could return null instead of "" (an empty string) as specified in the JDBC API.
@changelog_1013_li @changelog_1026_li
Added compatibility for "SET NAMES" query in MySQL compatibility mode. Added compatibility for "SET NAMES" query in MySQL compatibility mode.
@changelog_1014_h2 @changelog_1027_h2
Version 1.3.168 (2012-07-13) Version 1.3.168 (2012-07-13)
@changelog_1015_li @changelog_1028_li
The message "Transaction log could not be truncated" was sometimes written to the .trace.db file even if there was no problem truncating the transaction log. The message "Transaction log could not be truncated" was sometimes written to the .trace.db file even if there was no problem truncating the transaction log.
@changelog_1016_li @changelog_1029_li
New system property "h2.serializeJavaObject" (default: true) that allows to disable serializing Java objects, so that the objects compareTo and toString methods can be used. New system property "h2.serializeJavaObject" (default: true) that allows to disable serializing Java objects, so that the objects compareTo and toString methods can be used.
@changelog_1017_li @changelog_1030_li
Dylan has translated the H2 Console tool to Korean. Thanks a lot! Dylan has translated the H2 Console tool to Korean. Thanks a lot!
@changelog_1018_li @changelog_1031_li
Executing the statement CREATE INDEX IF ALREADY EXISTS if the index already exists no longer fails for a read only database. Executing the statement CREATE INDEX IF ALREADY EXISTS if the index already exists no longer fails for a read only database.
@changelog_1019_li @changelog_1032_li
MVCC: concurrently updating a row could result in the row to appear deleted in the second connection, if there are multiple unique indexes (or a primary key and at least one unique index). Thanks a lot to Teruo for the patch! MVCC: concurrently updating a row could result in the row to appear deleted in the second connection, if there are multiple unique indexes (or a primary key and at least one unique index). Thanks a lot to Teruo for the patch!
@changelog_1020_li @changelog_1033_li
Fulltext search: in-memory Lucene indexes are now supported. Fulltext search: in-memory Lucene indexes are now supported.
@changelog_1021_li @changelog_1034_li
Fulltext search: UUID primary keys are now supported. Fulltext search: UUID primary keys are now supported.
@changelog_1022_li @changelog_1035_li
Apache Tomcat 7.x will now longer log a warning when unloading the web application, if using a connection pool. Apache Tomcat 7.x will now longer log a warning when unloading the web application, if using a connection pool.
@changelog_1023_li @changelog_1036_li
H2 Console: support the Midori browser (for Debian / Raspberry Pi) H2 Console: support the Midori browser (for Debian / Raspberry Pi)
@changelog_1024_li @changelog_1037_li
When opening a remote session, don't open a temporary file if the trace level is set to zero When opening a remote session, don't open a temporary file if the trace level is set to zero
@changelog_1025_li @changelog_1038_li
Use HMAC for authenticating remote LOB id's, removing the need for maintaining a cache, and removing the limit on the number of LOBs per result set. Use HMAC for authenticating remote LOB id's, removing the need for maintaining a cache, and removing the limit on the number of LOBs per result set.
@changelog_1026_li @changelog_1039_li
H2 Console: HTML and XML documents can now be edited in an updatable result set. There is (limited) support for editing multi-line documents. H2 Console: HTML and XML documents can now be edited in an updatable result set. There is (limited) support for editing multi-line documents.
@changelog_1027_h2 @changelog_1040_h2
Version 1.3.167 (2012-05-23) Version 1.3.167 (2012-05-23)
@changelog_1028_li @changelog_1041_li
H2 Console: when editing a row, an empty varchar column was replaced with a single space. H2 Console: when editing a row, an empty varchar column was replaced with a single space.
@changelog_1029_li @changelog_1042_li
Lukas Eder has updated the jOOQ documentation. Lukas Eder has updated the jOOQ documentation.
@changelog_1030_li @changelog_1043_li
Some nested joins could not be executed, for example: select * from (select * from (select * from a) a right join b b) c; Some nested joins could not be executed, for example: select * from (select * from (select * from a) a right join b b) c;
@changelog_1031_li @changelog_1044_li
MS SQL Server compatibility: ISNULL is now an alias for IFNULL. MS SQL Server compatibility: ISNULL is now an alias for IFNULL.
@changelog_1032_li @changelog_1045_li
Terrence Huang has completed the translation of the H2 Console tool to Chinese. Thanks a lot! Terrence Huang has completed the translation of the H2 Console tool to Chinese. Thanks a lot!
@changelog_1033_li @changelog_1046_li
Server mode: the number of CLOB / BLOB values that were cached on the server is now the maximum of: 5 times the SERVER_RESULT_SET_FETCH_SIZE (which is 100 by default), and SysProperties.SERVER_CACHED_OBJECTS. Server mode: the number of CLOB / BLOB values that were cached on the server is now the maximum of: 5 times the SERVER_RESULT_SET_FETCH_SIZE (which is 100 by default), and SysProperties.SERVER_CACHED_OBJECTS.
@changelog_1034_li @changelog_1047_li
In the trace file, the query execution time was incorrect in some cases, specially for the statement SET TRACE_LEVEL_FILE 2. In the trace file, the query execution time was incorrect in some cases, specially for the statement SET TRACE_LEVEL_FILE 2.
@changelog_1035_li @changelog_1048_li
The feature LOG_SIZE_LIMIT that was introduced in version 1.3.165 did not always work correctly (specially with regards to multithreading) and has been removed. The message "Transaction log could not be truncated" is still written to the .trace.db file if required. The feature LOG_SIZE_LIMIT that was introduced in version 1.3.165 did not always work correctly (specially with regards to multithreading) and has been removed. The message "Transaction log could not be truncated" is still written to the .trace.db file if required.
@changelog_1036_li @changelog_1049_li
Then reading from a resource using the prefix "classpath:", the ContextClassLoader is now used if the resource can't be read otherwise. Then reading from a resource using the prefix "classpath:", the ContextClassLoader is now used if the resource can't be read otherwise.
@changelog_1037_li @changelog_1050_li
DatabaseEventListener now calls setProgress whenever a statement starts and ends. DatabaseEventListener now calls setProgress whenever a statement starts and ends.
@changelog_1038_li @changelog_1051_li
DatabaseEventListener now calls setProgress periodically while a statement is running. DatabaseEventListener now calls setProgress periodically while a statement is running.
@changelog_1039_li @changelog_1052_li
The table INFORMATION_SCHEMA.FUNCTION_ALIASES now includes a column TYPE_NAME. The table INFORMATION_SCHEMA.FUNCTION_ALIASES now includes a column TYPE_NAME.
@changelog_1040_li @changelog_1053_li
Issue 378: when using views, the wrong values were bound to a parameter in some cases. Issue 378: when using views, the wrong values were bound to a parameter in some cases.
@changelog_1041_li @changelog_1054_li
Terrence Huang has translated the error messages to Chinese. Thanks a lot! Terrence Huang has translated the error messages to Chinese. Thanks a lot!
@changelog_1042_li @changelog_1055_li
TRUNC was added as an alias for TRUNCATE. TRUNC was added as an alias for TRUNCATE.
@changelog_1043_li @changelog_1056_li
Small optimisation for accessing result values by column name. Small optimisation for accessing result values by column name.
@changelog_1044_li @changelog_1057_li
Fix for bug in Statement.getMoreResults(int) Fix for bug in Statement.getMoreResults(int)
@changelog_1045_li @changelog_1058_li
The SCRIPT statements now supports filtering by schema and table. Thanks a lot to Jacob Qvortrup for providing the patch! The SCRIPT statements now supports filtering by schema and table. Thanks a lot to Jacob Qvortrup for providing the patch!
@changelog_1046_h2 @changelog_1059_h2
Version 1.3.166 (2012-04-08) Version 1.3.166 (2012-04-08)
@changelog_1047_li @changelog_1060_li
Indexes on column that are larger than half the page size (wide indexes) could sometimes get corrupt, resulting in an ArrayIndexOutOfBoundsException in PageBtree.getRow or "Row not found" in PageBtreeLeaf. Also, such indexes used too much disk space. Indexes on column that are larger than half the page size (wide indexes) could sometimes get corrupt, resulting in an ArrayIndexOutOfBoundsException in PageBtree.getRow or "Row not found" in PageBtreeLeaf. Also, such indexes used too much disk space.
@changelog_1048_li @changelog_1061_li
Server mode: when retrieving more than 64 rows each containing a CLOB or BLOB, the error message "The object is already closed" was thrown. Server mode: when retrieving more than 64 rows each containing a CLOB or BLOB, the error message "The object is already closed" was thrown.
@changelog_1049_li @changelog_1062_li
ConvertTraceFile: the time in the trace file is now parsed as a long. ConvertTraceFile: the time in the trace file is now parsed as a long.
@changelog_1050_li @changelog_1063_li
Invalid connection settings are now detected. Invalid connection settings are now detected.
@changelog_1051_li @changelog_1064_li
Issue 387: WHERE condition getting pushed into sub-query with LIMIT. Issue 387: WHERE condition getting pushed into sub-query with LIMIT.
@changelog_1052_h2 @changelog_1065_h2
Version 1.3.165 (2012-03-18) Version 1.3.165 (2012-03-18)
@changelog_1053_li @changelog_1066_li
Better string representation for decimal values (for example 0.00000000 instead of 0E-26). Better string representation for decimal values (for example 0.00000000 instead of 0E-26).
@changelog_1054_li @changelog_1067_li
Prepared statements could only be re-used if the same data types were used the second time they were executed. Prepared statements could only be re-used if the same data types were used the second time they were executed.
@changelog_1055_li @changelog_1068_li
In error messages about referential constraint violation, the values are now included. In error messages about referential constraint violation, the values are now included.
@changelog_1056_li @changelog_1069_li
SCRIPT and RUNSCRIPT: the password can now be set using a prepared statement. Previously, it was required to be a literal in the SQL statement. SCRIPT and RUNSCRIPT: the password can now be set using a prepared statement. Previously, it was required to be a literal in the SQL statement.
@changelog_1057_li @changelog_1070_li
MySQL compatibility: SUBSTR with a negative start index now works like MySQL. MySQL compatibility: SUBSTR with a negative start index now works like MySQL.
@changelog_1058_li @changelog_1071_li
When enabling autocommit, the transaction is now committed (as required by the JDBC API). When enabling autocommit, the transaction is now committed (as required by the JDBC API).
@changelog_1059_li @changelog_1072_li
The shell script <code>h2.sh</code> did not work with spaces in the path. It also works now with quoted spaces in the argument list. Thanks a lot to Shimizu Fumiyuki for the patch! The shell script <code>h2.sh</code> did not work with spaces in the path. It also works now with quoted spaces in the argument list. Thanks a lot to Shimizu Fumiyuki for the patch!
@changelog_1060_li @changelog_1073_li
If the transaction log could not be truncated because of an uncommitted transaction, now "Transaction log could not be truncated" is written to the .trace.db file. Before, the database file was growing and it was hard to find out what the root cause was. To avoid the database file from growing, a new feature to automatically rollback the oldest transaction is available now. To enable it, append ;LOG_SIZE_LIMIT=32 to the database URL (in that case, the oldest session is rolled back if the transaction log is 32 MB). If the transaction log could not be truncated because of an uncommitted transaction, now "Transaction log could not be truncated" is written to the .trace.db file. Before, the database file was growing and it was hard to find out what the root cause was. To avoid the database file from growing, a new feature to automatically rollback the oldest transaction is available now. To enable it, append ;LOG_SIZE_LIMIT=32 to the database URL (in that case, the oldest session is rolled back if the transaction log is 32 MB).
@changelog_1061_li @changelog_1074_li
ALTER TABLE ADD can now add more than one column at a time. ALTER TABLE ADD can now add more than one column at a time.
@changelog_1062_li @changelog_1075_li
Issue 380: ALTER TABLE ADD FOREIGN KEY with an explicit index didn't verify the index can be used, which would lead to a NullPointerException later on. Issue 380: ALTER TABLE ADD FOREIGN KEY with an explicit index didn't verify the index can be used, which would lead to a NullPointerException later on.
@changelog_1063_li @changelog_1076_li
Issue 384: the wrong kind of exception (NullPointerException) was thrown in a UNION query with an incorrect ORDER BY expression. Issue 384: the wrong kind of exception (NullPointerException) was thrown in a UNION query with an incorrect ORDER BY expression.
@changelog_1064_li @changelog_1077_li
Issue 362: support LIMIT in UPDATE statements. Issue 362: support LIMIT in UPDATE statements.
@changelog_1065_li @changelog_1078_li
Browser: if no default browser is set, Google Chrome is now used if available. If not available, then Konqueror, Netscape, or Opera is used if available (as before). Browser: if no default browser is set, Google Chrome is now used if available. If not available, then Konqueror, Netscape, or Opera is used if available (as before).
@changelog_1066_li @changelog_1079_li
CSV tool: new feature to disable writing the column header (option writeColumnHeader). CSV tool: new feature to disable writing the column header (option writeColumnHeader).
@changelog_1067_li @changelog_1080_li
CSV tool: new feature to preserve the case sensitivity of column names (option caseSensitiveColumnNames). CSV tool: new feature to preserve the case sensitivity of column names (option caseSensitiveColumnNames).
@changelog_1068_li @changelog_1081_li
PostgreSQL compatibility: LOG(x) is base 10 in the PostgreSQL mode. PostgreSQL compatibility: LOG(x) is base 10 in the PostgreSQL mode.
@changelog_1069_h2 @changelog_1082_h2
Version 1.3.164 (2012-02-03) Version 1.3.164 (2012-02-03)
@changelog_1070_li @changelog_1083_li
New built-in function ARRAY_CONTAINS. New built-in function ARRAY_CONTAINS.
@changelog_1071_li @changelog_1084_li
Some DatabaseMetaData methods didn't work when using ALLOW_LITERALS NONE. Some DatabaseMetaData methods didn't work when using ALLOW_LITERALS NONE.
@changelog_1072_li @changelog_1085_li
Trying to convert a VARCHAR to UUID will now fail if the text contains a character that is not a hex digit, '-', or not a whitespace. Trying to convert a VARCHAR to UUID will now fail if the text contains a character that is not a hex digit, '-', or not a whitespace.
@changelog_1073_li @changelog_1086_li
TriggerAdapter: in "before" triggers, values can be changed using the ResultSet.updateX methods. TriggerAdapter: in "before" triggers, values can be changed using the ResultSet.updateX methods.
@changelog_1074_li @changelog_1087_li
Creating a table with column data type NULL now works (even if not very useful). Creating a table with column data type NULL now works (even if not very useful).
@changelog_1075_li @changelog_1088_li
ALTER TABLE ALTER COLUMN no longer copies the data for widening conversions (for example if only the precision was increased) unless necessary. ALTER TABLE ALTER COLUMN no longer copies the data for widening conversions (for example if only the precision was increased) unless necessary.
@changelog_1076_li @changelog_1089_li
Multi-threaded kernel: concurrently running an online backup and updating the database resulted in a broken (transactionally incorrect) backup file in some cases. Multi-threaded kernel: concurrently running an online backup and updating the database resulted in a broken (transactionally incorrect) backup file in some cases.
@changelog_1077_li @changelog_1090_li
The script created by SCRIPT DROP did not always work if multiple views existed that depend on each other. The script created by SCRIPT DROP did not always work if multiple views existed that depend on each other.
@changelog_1078_li @changelog_1091_li
MathUtils.getSecureRandom could log a warning to System.err in case the /dev/random is very slow, and the System.getProperties().toString() returned a string larger than 64 KB. MathUtils.getSecureRandom could log a warning to System.err in case the /dev/random is very slow, and the System.getProperties().toString() returned a string larger than 64 KB.
@changelog_1079_li @changelog_1092_li
The database file locking mechanism "FS" (;FILE_LOCK=FS) did not work on Linux since version 1.3.161. The database file locking mechanism "FS" (;FILE_LOCK=FS) did not work on Linux since version 1.3.161.
@changelog_1080_li @changelog_1093_li
Sequences: the functions NEXTVAL and CURRVAL did not work as expected when using quoted, mixed case sequence names. Sequences: the functions NEXTVAL and CURRVAL did not work as expected when using quoted, mixed case sequence names.
@changelog_1081_li @changelog_1094_li
The constructor for Csv objects is now public, and Csv.getInstance() is now deprecated. The constructor for Csv objects is now public, and Csv.getInstance() is now deprecated.
@changelog_1082_li @changelog_1095_li
SimpleResultSet: updating a result set is now supported. SimpleResultSet: updating a result set is now supported.
@changelog_1083_li @changelog_1096_li
Database URL: extra semicolons are not supported. Database URL: extra semicolons are not supported.
@changelog_1084_h2 @changelog_1097_h2
Version 1.3.163 (2011-12-30) Version 1.3.163 (2011-12-30)
@changelog_1085_li @changelog_1098_li
On out of disk space, the database could get corrupt sometimes, if later write operations succeeded. The same problem happened on other kinds of I/O exceptions (where one or some of the writes fail, but subsequent writes succeed). Now the file is closed on the first unsuccessful write operation, so that later requests fail consistently. On out of disk space, the database could get corrupt sometimes, if later write operations succeeded. The same problem happened on other kinds of I/O exceptions (where one or some of the writes fail, but subsequent writes succeed). Now the file is closed on the first unsuccessful write operation, so that later requests fail consistently.
@changelog_1086_li @changelog_1099_li
DatabaseEventListener.diskSpaceIsLow() is no longer supported because it can't be guaranteed that it always works correctly. DatabaseEventListener.diskSpaceIsLow() is no longer supported because it can't be guaranteed that it always works correctly.
@changelog_1087_li @changelog_1100_li
XMLTEXT now supports an optional parameter to escape newlines. XMLTEXT now supports an optional parameter to escape newlines.
@changelog_1088_li @changelog_1101_li
XMLNODE now support an optional parameter to disable indentation. XMLNODE now support an optional parameter to disable indentation.
@changelog_1089_li @changelog_1102_li
Csv.write now formats date, time, and timestamp values using java.sql.Date / Time / Timestamp.toString(). Previously, ResultSet.getString() was used, which didn't work well for Oracle. Csv.write now formats date, time, and timestamp values using java.sql.Date / Time / Timestamp.toString(). Previously, ResultSet.getString() was used, which didn't work well for Oracle.
@changelog_1090_li @changelog_1103_li
The shell script <code>h2.sh</code> can now be run from within a different directory. Thanks a lot to Daniel Serodio for the patch! The shell script <code>h2.sh</code> can now be run from within a different directory. Thanks a lot to Daniel Serodio for the patch!
@changelog_1091_li @changelog_1104_li
The page size of a persistent database can now be queries using: select * from information_schema.settings where name = 'info.PAGE_SIZE' The page size of a persistent database can now be queries using: select * from information_schema.settings where name = 'info.PAGE_SIZE'
@changelog_1092_li @changelog_1105_li
In the server mode, BLOB and CLOB objects are no longer closed when the result set is closed (as required by the JDBC spec). In the server mode, BLOB and CLOB objects are no longer closed when the result set is closed (as required by the JDBC spec).
@changelog_1093_h2 @changelog_1106_h2
Version 1.3.162 (2011-11-26) Version 1.3.162 (2011-11-26)
@changelog_1094_li @changelog_1107_li
The following system properties are no longer supported: <code>h2.allowBigDecimalExtensions</code>, <code>h2.emptyPassword</code>, <code>h2.minColumnNameMap</code>, <code>h2.returnLobObjects</code>, <code>h2.webMaxValueLength</code>. The following system properties are no longer supported: <code>h2.allowBigDecimalExtensions</code>, <code>h2.emptyPassword</code>, <code>h2.minColumnNameMap</code>, <code>h2.returnLobObjects</code>, <code>h2.webMaxValueLength</code>.
@changelog_1095_li @changelog_1108_li
When using a VPN, starting a H2 server did not work (for some VPN software). When using a VPN, starting a H2 server did not work (for some VPN software).
@changelog_1096_li @changelog_1109_li
Oracle compatibility: support for DECODE(...). Oracle compatibility: support for DECODE(...).
@changelog_1097_li @changelog_1110_li
Lucene fulltext search: creating an index is now faster if the table already contains data. Thanks a lot to Angel Leon from the FrostWire Team for the patch! Lucene fulltext search: creating an index is now faster if the table already contains data. Thanks a lot to Angel Leon from the FrostWire Team for the patch!
@changelog_1098_li @changelog_1111_li
Update statements with a column list in brackets did not work if the list only contains one column. Example: update test set (id)=(id). Update statements with a column list in brackets did not work if the list only contains one column. Example: update test set (id)=(id).
@changelog_1099_li @changelog_1112_li
Read-only databases in a zip file did not work when using the -baseDir option. Read-only databases in a zip file did not work when using the -baseDir option.
@changelog_1100_li @changelog_1113_li
Issue 334: SimpleResultSet.getString now also works for Clob columns. Issue 334: SimpleResultSet.getString now also works for Clob columns.
@changelog_1101_li @changelog_1114_li
Subqueries with an aggregate did not always work. Example: select (select count(*) from test where a = t.a and b = 0) from test t group by a Subqueries with an aggregate did not always work. Example: select (select count(*) from test where a = t.a and b = 0) from test t group by a
@changelog_1102_li @changelog_1115_li
Server: in some (theoretical) cases, exceptions while closing the connection were ignored. Server: in some (theoretical) cases, exceptions while closing the connection were ignored.
@changelog_1103_li @changelog_1116_li
Server.createTcpServer, createPgServer, createWebServer: invalid arguments are now detected. Server.createTcpServer, createPgServer, createWebServer: invalid arguments are now detected.
@changelog_1104_li @changelog_1117_li
The selectivity of LOB columns is no longer calculated because indexes on LOB columns are not supported (however this should have little effect on performance, as the selectivity is calculated from the hash code and not the data). The selectivity of LOB columns is no longer calculated because indexes on LOB columns are not supported (however this should have little effect on performance, as the selectivity is calculated from the hash code and not the data).
@changelog_1105_li @changelog_1118_li
New experimental system property "h2.modifyOnWrite": when enabled, the database file is only modified when writing to the database. When enabled, the serialized file lock is much faster for read-only operations. New experimental system property "h2.modifyOnWrite": when enabled, the database file is only modified when writing to the database. When enabled, the serialized file lock is much faster for read-only operations.
@changelog_1106_li @changelog_1119_li
A NullPointerException could occur in TableView.isDeterministic for invalid views. A NullPointerException could occur in TableView.isDeterministic for invalid views.
@changelog_1107_li @changelog_1120_li
Issue 180: when deserializing objects, the context class loader is used instead of the default class loader if the system property "h2.useThreadContextClassLoader" is set. Thanks a lot to Noah Fontes for the patch! Issue 180: when deserializing objects, the context class loader is used instead of the default class loader if the system property "h2.useThreadContextClassLoader" is set. Thanks a lot to Noah Fontes for the patch!
@changelog_1108_li @changelog_1121_li
When using the exclusive mode, LOB operations could cause the thread to block. This also affected the CreateCluster tool (when using BLOB or CLOB data). When using the exclusive mode, LOB operations could cause the thread to block. This also affected the CreateCluster tool (when using BLOB or CLOB data).
@changelog_1109_li @changelog_1122_li
The optimization for "group by" was not working correctly if the group by column was aliased in the select list. The optimization for "group by" was not working correctly if the group by column was aliased in the select list.
@changelog_1110_li @changelog_1123_li
Issue 326: improved support for case sensitive (mixed case) identifiers without quotes when using DATABASE_TO_UPPER=FALSE. Issue 326: improved support for case sensitive (mixed case) identifiers without quotes when using DATABASE_TO_UPPER=FALSE.
@changelog_1111_h2 @changelog_1124_h2
Version 1.3.161 (2011-10-28) Version 1.3.161 (2011-10-28)
@changelog_1112_li @changelog_1125_li
Issue 351: MySQL mode: can not create a table with the column "KEY", and can not open databases where such a table already exists. Issue 351: MySQL mode: can not create a table with the column "KEY", and can not open databases where such a table already exists.
@changelog_1113_li @changelog_1126_li
TCP server: when using the trace option ("-trace"), the trace output contained unnecessary stack traces when stopping the server. TCP server: when using the trace option ("-trace"), the trace output contained unnecessary stack traces when stopping the server.
@changelog_1114_li @changelog_1127_li
Issue 354: when using the multi-threaded kernel option, and multiple threads concurrently prepared SQL statements that use the same view or the same index of a view, then in some cases an infinite loop could occur. Issue 354: when using the multi-threaded kernel option, and multiple threads concurrently prepared SQL statements that use the same view or the same index of a view, then in some cases an infinite loop could occur.
@changelog_1115_li @changelog_1128_li
Issue 350: when using instead of triggers, executeUpdate for delete operations always returned 0. Issue 350: when using instead of triggers, executeUpdate for delete operations always returned 0.
@changelog_1116_li @changelog_1129_li
Some timestamps with timezone were not converted correctly. For example, in the PST timezone, the timestamp 2011-10-26 08:00:00Z was converted to 2011-10-25 25:00:00 instead of 2011-10-26 01:00:00. Depending on the database operation, this caused subsequent error. Some timestamps with timezone were not converted correctly. For example, in the PST timezone, the timestamp 2011-10-26 08:00:00Z was converted to 2011-10-25 25:00:00 instead of 2011-10-26 01:00:00. Depending on the database operation, this caused subsequent error.
@changelog_1117_li @changelog_1130_li
Sequences with cache size smaller than 0 did not work correctly. Sequences with cache size smaller than 0 did not work correctly.
@changelog_1118_li @changelog_1131_li
Issue 356: for Blob objects, InputStream.skip() returned 0, causing EOFException in Blob.getBytes(.., ..). Issue 356: for Blob objects, InputStream.skip() returned 0, causing EOFException in Blob.getBytes(.., ..).
@changelog_1119_li @changelog_1132_li
Updatable result sets: if the value is not set when inserting a new row, the default value is now used (the same behavior as MySQL, PostgreSQL, and Apache Derby) instead of NULL. Updatable result sets: if the value is not set when inserting a new row, the default value is now used (the same behavior as MySQL, PostgreSQL, and Apache Derby) instead of NULL.
@changelog_1120_li @changelog_1133_li
Conditions of the form IN(SELECT ...) where slow and increased the database size if the subquery result size was larger then the configured MAX_MEMORY_ROWS. Conditions of the form IN(SELECT ...) where slow and increased the database size if the subquery result size was larger then the configured MAX_MEMORY_ROWS.
@changelog_1121_li @changelog_1134_li
Issue 347: the RunScript and Shell tools now ignore empty statements. Issue 347: the RunScript and Shell tools now ignore empty statements.
@changelog_1122_li @changelog_1135_li
Issue 246: improved error message for data conversion problems. Issue 246: improved error message for data conversion problems.
@changelog_1123_li @changelog_1136_li
Issue 344: the build now supports a custom Maven repository location. Issue 344: the build now supports a custom Maven repository location.
@changelog_1124_li @changelog_1137_li
Issue 334: Java functions that return CLOB or BLOB objects could not be used as tables. Issue 334: Java functions that return CLOB or BLOB objects could not be used as tables.
@changelog_1125_li @changelog_1138_li
SimpleResultSet now supports getColumnTypeName and getColumnClassName. SimpleResultSet now supports getColumnTypeName and getColumnClassName.
@changelog_1126_li @changelog_1139_li
SimpleResultSet now has minimal BLOB and CLOB support. SimpleResultSet now has minimal BLOB and CLOB support.
@changelog_1127_li @changelog_1140_li
Improved performance for large databases (many GB), and databases with a small page size. Improved performance for large databases (many GB), and databases with a small page size.
@changelog_1128_li @changelog_1141_li
The Polish translation has been improved by Jaros&#322;aw Kokoci&#324;ski. The Polish translation has been improved by Jaros&#322;aw Kokoci&#324;ski.
@changelog_1129_li @changelog_1142_li
When using the built-in connection pool, after calling the "shutdown" SQL statement, a warning was written to the .trace.db file about an unclosed connection. When using the built-in connection pool, after calling the "shutdown" SQL statement, a warning was written to the .trace.db file about an unclosed connection.
@changelog_1130_li @changelog_1143_li
Improved compatibility for "fetch first / next row(s)". Thanks a lot to litailang for the patch! Improved compatibility for "fetch first / next row(s)". Thanks a lot to litailang for the patch!
@changelog_1131_li @changelog_1144_li
Improved compatibility with the Java 7 FileSystem abstraction. Improved compatibility with the Java 7 FileSystem abstraction.
@changelog_1132_h2 @changelog_1145_h2
Version 1.3.160 (2011-09-11) Version 1.3.160 (2011-09-11)
@changelog_1133_li @changelog_1146_li
Computed columns could not refer to itself. Computed columns could not refer to itself.
@changelog_1134_li @changelog_1147_li
Issue 340: Comparison with "x = all(select ...)" or similar in a view or subquery that was used as a table returned the wrong result. Issue 340: Comparison with "x = all(select ...)" or similar in a view or subquery that was used as a table returned the wrong result.
@changelog_1135_li @changelog_1148_li
Comparison with "x = all(select ...)" or similar returned the wrong result for some cases (for example if the subquery returned no rows, or multiple rows with the same value, or null, or if x was null). Comparison with "x = all(select ...)" or similar returned the wrong result for some cases (for example if the subquery returned no rows, or multiple rows with the same value, or null, or if x was null).
@changelog_1136_li @changelog_1149_li
Issue 335: Could not run DROP ALL OBJECTS DELETE FILES on older databases with CLOB or BLOB data. The problem was that the metadata table was not locked in some cases, so that a rollback could result in a corrupt database in a database if the lob storage was upgraded. Issue 335: Could not run DROP ALL OBJECTS DELETE FILES on older databases with CLOB or BLOB data. The problem was that the metadata table was not locked in some cases, so that a rollback could result in a corrupt database in a database if the lob storage was upgraded.
@changelog_1137_li @changelog_1150_li
Source code switching using //## has been simplified. The Java 1.5 tag has been removed because is no longer needed. Source code switching using //## has been simplified. The Java 1.5 tag has been removed because is no longer needed.
@changelog_1138_li @changelog_1151_li
The JDBC methods PreparedStatement.setTimestamp, setTime, and setDate with a calendar, and the methods ResultSet.getTimestamp, getTime, and getDate with a calendar converted the value in the wrong way, so that for some timestamps the converted value was wrong (where summertime starts, one hour per year). The JDBC methods PreparedStatement.setTimestamp, setTime, and setDate with a calendar, and the methods ResultSet.getTimestamp, getTime, and getDate with a calendar converted the value in the wrong way, so that for some timestamps the converted value was wrong (where summertime starts, one hour per year).
@changelog_1139_li @changelog_1152_li
Invalid tables names in 'order by' columns were not detected in some cases. Example: select x from dual order by y.x Invalid tables names in 'order by' columns were not detected in some cases. Example: select x from dual order by y.x
@changelog_1140_li @changelog_1153_li
Issue 329: CASE expression: data type problem is not detected. Issue 329: CASE expression: data type problem is not detected.
@changelog_1141_li @changelog_1154_li
Issue 311: File lock mode serialized: selecting the next value from a sequence didn't work after a pause, because the database thought this is a read-only operation. Issue 311: File lock mode serialized: selecting the next value from a sequence didn't work after a pause, because the database thought this is a read-only operation.
@changelog_1142_h2 @changelog_1155_h2
Version 1.3.159 (2011-08-13) Version 1.3.159 (2011-08-13)
@changelog_1143_li @changelog_1156_li
Creating a temporary table with the option 'transactional' will now also create the indexes in transactional mode, if the indexes are included in the 'create table' statement as follows: "create local temporary table temp(id int primary key, name varchar, constraint x index(name)) transactional". Creating a temporary table with the option 'transactional' will now also create the indexes in transactional mode, if the indexes are included in the 'create table' statement as follows: "create local temporary table temp(id int primary key, name varchar, constraint x index(name)) transactional".
@changelog_1144_li @changelog_1157_li
The database file size grows now 35%, but at most 256 MB at a time. The database file size grows now 35%, but at most 256 MB at a time.
@changelog_1145_li @changelog_1158_li
Improved error message on network configuration problems. Improved error message on network configuration problems.
@changelog_1146_li @changelog_1159_li
The build now support an offline build using ./build.sh offline. This will list the required dependencies if jar files are missing. The build now support an offline build using ./build.sh offline. This will list the required dependencies if jar files are missing.
@changelog_1147_li @changelog_1160_li
The BLOB / CLOB data was dropped a little bit before the table was dropped. This could cause "lob not found" errors when the process was killed while a table was dropped. The BLOB / CLOB data was dropped a little bit before the table was dropped. This could cause "lob not found" errors when the process was killed while a table was dropped.
@changelog_1148_li @changelog_1161_li
"group_concat(distinct ...)" did not work correctly in a view or subquery (the 'distinct' was lost). Example: select * from (select group_concat(distinct 1) from system_range(1, 3)); "group_concat(distinct ...)" did not work correctly in a view or subquery (the 'distinct' was lost). Example: select * from (select group_concat(distinct 1) from system_range(1, 3));
@changelog_1149_li @changelog_1162_li
Database URLs can now be re-mapped to another URL using the system property "h2.urlMap", which points to a properties file with database URL mappings. Database URLs can now be re-mapped to another URL using the system property "h2.urlMap", which points to a properties file with database URL mappings.
@changelog_1150_li @changelog_1163_li
When using InputStream.skip, trying to read past the end of a BLOB failed with the exception "IO Exception: Missing lob entry: ..." [90028-...]. When using InputStream.skip, trying to read past the end of a BLOB failed with the exception "IO Exception: Missing lob entry: ..." [90028-...].
@changelog_1151_li @changelog_1164_li
The in-memory file system "memFS:" now has limited support for directories. The in-memory file system "memFS:" now has limited support for directories.
@changelog_1152_li @changelog_1165_li
To test recovery, append ;RECOVER_TEST=64 to the database URL. This will simulate an application crash after each 64 writes to the database file. A log file named databaseName.h2.db.log is created that lists the operations. The recovery is tested using an in-memory file system, that means it may require a larger heap setting. To test recovery, append ;RECOVER_TEST=64 to the database URL. This will simulate an application crash after each 64 writes to the database file. A log file named databaseName.h2.db.log is created that lists the operations. The recovery is tested using an in-memory file system, that means it may require a larger heap setting.
@changelog_1153_li @changelog_1166_li
Converting a hex string to a byte array is now faster. Converting a hex string to a byte array is now faster.
@changelog_1154_li @changelog_1167_li
The SQL statement "shutdown defrag" could corrupt the database if the process was killed while the shutdown was in progress. The same problem could occur when the database setting "defrag_always" was used. The SQL statement "shutdown defrag" could corrupt the database if the process was killed while the shutdown was in progress. The same problem could occur when the database setting "defrag_always" was used.
@cheatSheet_1000_h1 @cheatSheet_1000_h1
...@@ -2501,87 +2540,90 @@ Using the ICU4J collator. ...@@ -2501,87 +2540,90 @@ Using the ICU4J collator.
The PostgreSQL server The PostgreSQL server
@faq_1059_li @faq_1059_li
Multi-threading within the engine using <code>SET MULTI_THREADED=1</code>. Clustering (there are cases were transaction isolation can be broken due to timing issues, for example one session overtaking another session).
@faq_1060_li @faq_1060_li
Compatibility modes for other databases (only some features are implemented). Multi-threading within the engine using <code>SET MULTI_THREADED=1</code>.
@faq_1061_li @faq_1061_li
Compatibility modes for other databases (only some features are implemented).
@faq_1062_li
The soft reference cache (<code>CACHE_TYPE=SOFT_LRU</code>). It might not improve performance, and out of memory issues have been reported. The soft reference cache (<code>CACHE_TYPE=SOFT_LRU</code>). It might not improve performance, and out of memory issues have been reported.
@faq_1062_p @faq_1063_p
Some users have reported that after a power failure, the database cannot be opened sometimes. In this case, use a backup of the database or the Recover tool. Please report such problems. The plan is that the database automatically recovers in all situations. Some users have reported that after a power failure, the database cannot be opened sometimes. In this case, use a backup of the database or the Recover tool. Please report such problems. The plan is that the database automatically recovers in all situations.
@faq_1063_h3 @faq_1064_h3
Why is Opening my Database Slow? Why is Opening my Database Slow?
@faq_1064_p @faq_1065_p
To find out what the problem is, use the H2 Console and click on "Test Connection" instead of "Login". After the "Login Successful" appears, click on it (it's a link). This will list the top stack traces. Then either analyze this yourself, or post those stack traces in the Google Group. To find out what the problem is, use the H2 Console and click on "Test Connection" instead of "Login". After the "Login Successful" appears, click on it (it's a link). This will list the top stack traces. Then either analyze this yourself, or post those stack traces in the Google Group.
@faq_1065_p @faq_1066_p
Other possible reasons are: the database is very big (many GB), or contains linked tables that are slow to open. Other possible reasons are: the database is very big (many GB), or contains linked tables that are slow to open.
@faq_1066_h3 @faq_1067_h3
My Query is Slow My Query is Slow
@faq_1067_p @faq_1068_p
Slow <code>SELECT</code> (or <code>DELETE, UPDATE, MERGE</code>) statement can have multiple reasons. Follow this checklist: Slow <code>SELECT</code> (or <code>DELETE, UPDATE, MERGE</code>) statement can have multiple reasons. Follow this checklist:
@faq_1068_li @faq_1069_li
Run <code>ANALYZE</code> (see documentation for details). Run <code>ANALYZE</code> (see documentation for details).
@faq_1069_li @faq_1070_li
Run the query with <code>EXPLAIN</code> and check if indexes are used (see documentation for details). Run the query with <code>EXPLAIN</code> and check if indexes are used (see documentation for details).
@faq_1070_li @faq_1071_li
If required, create additional indexes and try again using <code>ANALYZE</code> and <code>EXPLAIN</code>. If required, create additional indexes and try again using <code>ANALYZE</code> and <code>EXPLAIN</code>.
@faq_1071_li @faq_1072_li
If it doesn't help please report the problem. If it doesn't help please report the problem.
@faq_1072_h3 @faq_1073_h3
H2 is Very Slow H2 is Very Slow
@faq_1073_p @faq_1074_p
By default, H2 closes the database when the last connection is closed. If your application closes the only connection after each operation, the database is opened and closed a lot, which is quite slow. There are multiple ways to solve this problem, see <a href="performance.html#database_performance_tuning">Database Performance Tuning</a>. By default, H2 closes the database when the last connection is closed. If your application closes the only connection after each operation, the database is opened and closed a lot, which is quite slow. There are multiple ways to solve this problem, see <a href="performance.html#database_performance_tuning">Database Performance Tuning</a>.
@faq_1074_h3 @faq_1075_h3
Column Names are Incorrect? Column Names are Incorrect?
@faq_1075_p @faq_1076_p
For the query <code>SELECT ID AS X FROM TEST</code> the method <code>ResultSetMetaData.getColumnName()</code> returns <code>ID</code>, I expect it to return <code>X</code>. What's wrong? For the query <code>SELECT ID AS X FROM TEST</code> the method <code>ResultSetMetaData.getColumnName()</code> returns <code>ID</code>, I expect it to return <code>X</code>. What's wrong?
@faq_1076_p @faq_1077_p
This is not a bug. According the the JDBC specification, the method <code>ResultSetMetaData.getColumnName()</code> should return the name of the column and not the alias name. If you need the alias name, use <a href="http://java.sun.com/javase/6/docs/api/java/sql/ResultSetMetaData.html#getColumnLabel(int)"><code>ResultSetMetaData.getColumnLabel()</code></a>. Some other database don't work like this yet (they don't follow the JDBC specification). If you need compatibility with those databases, use the <a href="features.html#compatibility">Compatibility Mode</a>, or append <a href="../javadoc/org/h2/constant/DbSettings.html#ALIAS_COLUMN_NAME"><code>;ALIAS_COLUMN_NAME=TRUE</code></a> to the database URL. This is not a bug. According the the JDBC specification, the method <code>ResultSetMetaData.getColumnName()</code> should return the name of the column and not the alias name. If you need the alias name, use <a href="http://java.sun.com/javase/6/docs/api/java/sql/ResultSetMetaData.html#getColumnLabel(int)"><code>ResultSetMetaData.getColumnLabel()</code></a>. Some other database don't work like this yet (they don't follow the JDBC specification). If you need compatibility with those databases, use the <a href="features.html#compatibility">Compatibility Mode</a>, or append <a href="../javadoc/org/h2/constant/DbSettings.html#ALIAS_COLUMN_NAME"><code>;ALIAS_COLUMN_NAME=TRUE</code></a> to the database URL.
@faq_1077_p @faq_1078_p
This also applies to DatabaseMetaData calls that return a result set. The columns in the JDBC API are column labels, not column names. This also applies to DatabaseMetaData calls that return a result set. The columns in the JDBC API are column labels, not column names.
@faq_1078_h3 @faq_1079_h3
Float is Double? Float is Double?
@faq_1079_p @faq_1080_p
For a table defined as <code>CREATE TABLE TEST(X FLOAT)</code> the method <code>ResultSet.getObject()</code> returns a <code>java.lang.Double</code>, I expect it to return a <code>java.lang.Float</code>. What's wrong? For a table defined as <code>CREATE TABLE TEST(X FLOAT)</code> the method <code>ResultSet.getObject()</code> returns a <code>java.lang.Double</code>, I expect it to return a <code>java.lang.Float</code>. What's wrong?
@faq_1080_p @faq_1081_p
This is not a bug. According the the JDBC specification, the JDBC data type <code>FLOAT</code> is equivalent to <code>DOUBLE</code>, and both are mapped to <code>java.lang.Double</code>. See also <a href="http://java.sun.com/j2se/1.5.0/docs/guide/jdbc/getstart/mapping.html#1055162"> Mapping SQL and Java Types - 8.3.10 FLOAT</a>. This is not a bug. According the the JDBC specification, the JDBC data type <code>FLOAT</code> is equivalent to <code>DOUBLE</code>, and both are mapped to <code>java.lang.Double</code>. See also <a href="http://java.sun.com/j2se/1.5.0/docs/guide/jdbc/getstart/mapping.html#1055162"> Mapping SQL and Java Types - 8.3.10 FLOAT</a>.
@faq_1081_h3 @faq_1082_h3
Is the GCJ Version Stable? Faster? Is the GCJ Version Stable? Faster?
@faq_1082_p @faq_1083_p
The GCJ version is not as stable as the Java version. When running the regression test with the GCJ version, sometimes the application just stops at what seems to be a random point without error message. Currently, the GCJ version is also slower than when using the Sun VM. However, the startup of the GCJ version is faster than when using a VM. The GCJ version is not as stable as the Java version. When running the regression test with the GCJ version, sometimes the application just stops at what seems to be a random point without error message. Currently, the GCJ version is also slower than when using the Sun VM. However, the startup of the GCJ version is faster than when using a VM.
@faq_1083_h3 @faq_1084_h3
How to Translate this Project? How to Translate this Project?
@faq_1084_p @faq_1085_p
For more information, see <a href="build.html#translating">Build/Translating</a>. For more information, see <a href="build.html#translating">Build/Translating</a>.
@faq_1085_h3 @faq_1086_h3
How to Contribute to this Project? How to Contribute to this Project?
@faq_1086_p @faq_1087_p
There are various way to help develop an open source project like H2. The first step could be to <a href="build.html#translating">translate</a> the error messages and the GUI to your native language. Then, you could <a href="build.html#providing_patches">provide patches</a>. Please start with small patches. That could be adding a test case to improve the <a href="build.html#automated">code coverage</a> (the target code coverage for this project is 90%, higher is better). You will have to <a href="build.html">develop, build and run the tests</a>. Once you are familiar with the code, you could implement missing features from the <a href="roadmap.html">feature request list</a>. I suggest to start with very small features that are easy to implement. Keep in mind to provide test cases as well. There are various way to help develop an open source project like H2. The first step could be to <a href="build.html#translating">translate</a> the error messages and the GUI to your native language. Then, you could <a href="build.html#providing_patches">provide patches</a>. Please start with small patches. That could be adding a test case to improve the <a href="build.html#automated">code coverage</a> (the target code coverage for this project is 90%, higher is better). You will have to <a href="build.html">develop, build and run the tests</a>. Once you are familiar with the code, you could implement missing features from the <a href="roadmap.html">feature request list</a>. I suggest to start with very small features that are easy to implement. Keep in mind to provide test cases as well.
@features_1000_h1 @features_1000_h1
...@@ -4501,7 +4543,10 @@ Links ...@@ -4501,7 +4543,10 @@ Links
@fragments_1030_a @fragments_1030_a
JaQu JaQu
@fragments_1031_td @fragments_1031_a
MVStore
@fragments_1032_td
&nbsp; &nbsp;
@frame_1000_h1 @frame_1000_h1
...@@ -4640,128 +4685,134 @@ StockMarketEye, USA ...@@ -4640,128 +4685,134 @@ StockMarketEye, USA
Eckenfelder GmbH & Co.KG, Germany Eckenfelder GmbH & Co.KG, Germany
@history_1034_li @history_1034_li
Alessio Jacopo D'Adamo, Italy Richard Hickey, USA
@history_1035_li @history_1035_li
Ashwin Jayaprakash, USA Alessio Jacopo D'Adamo, Italy
@history_1036_li @history_1036_li
Donald Bleyl, USA Ashwin Jayaprakash, USA
@history_1037_li @history_1037_li
Frank Berger, Germany Donald Bleyl, USA
@history_1038_li @history_1038_li
Florent Ramiere, France Frank Berger, Germany
@history_1039_li @history_1039_li
Jun Iyama, Japan Florent Ramiere, France
@history_1040_li @history_1040_li
Antonio Casqueiro, Portugal Jun Iyama, Japan
@history_1041_li @history_1041_li
Oliver Computing LLC, USA Antonio Casqueiro, Portugal
@history_1042_li @history_1042_li
Harpal Grover Consulting Inc., USA Oliver Computing LLC, USA
@history_1043_li @history_1043_li
Elisabetta Berlini, Italy Harpal Grover Consulting Inc., USA
@history_1044_li @history_1044_li
William Gilbert, USA Elisabetta Berlini, Italy
@history_1045_li @history_1045_li
William Gilbert, USA
@history_1046_li
Antonio Dieguez Rojas, Chile Antonio Dieguez Rojas, Chile
@history_1046_a @history_1047_a
Ontology Works, USA Ontology Works, USA
@history_1047_li @history_1048_li
Pete Haidinyak, USA Pete Haidinyak, USA
@history_1048_li @history_1049_li
William Osmond, USA William Osmond, USA
@history_1049_li @history_1050_li
Joachim Ansorg, Germany Joachim Ansorg, Germany
@history_1050_li @history_1051_li
Oliver Soerensen, Germany Oliver Soerensen, Germany
@history_1051_li @history_1052_li
Christos Vasilakis, Greece Christos Vasilakis, Greece
@history_1052_li @history_1053_li
Fyodor Kupolov, Denmark Fyodor Kupolov, Denmark
@history_1053_li @history_1054_li
Jakob Jenkov, Denmark Jakob Jenkov, Denmark
@history_1054_li @history_1055_li
St&eacute;phane Chartrand, Switzerland St&eacute;phane Chartrand, Switzerland
@history_1055_li @history_1056_li
Glenn Kidd, USA Glenn Kidd, USA
@history_1056_li @history_1057_li
Gustav Trede, Sweden Gustav Trede, Sweden
@history_1057_li @history_1058_li
Joonas Pulakka, Finland Joonas Pulakka, Finland
@history_1058_li @history_1059_li
Bjorn Darri Sigurdsson, Iceland Bjorn Darri Sigurdsson, Iceland
@history_1059_li @history_1060_li
Iyama Jun, Japan Iyama Jun, Japan
@history_1060_li @history_1061_li
Gray Watson, USA Gray Watson, USA
@history_1061_li @history_1062_li
Erik Dick, Germany Erik Dick, Germany
@history_1062_li @history_1063_li
Pengxiang Shao, China Pengxiang Shao, China
@history_1063_li @history_1064_li
Bilingual Marketing Group, USA Bilingual Marketing Group, USA
@history_1064_li @history_1065_li
Philippe Marschall, Switzerland Philippe Marschall, Switzerland
@history_1065_li @history_1066_li
Knut Staring, Norway Knut Staring, Norway
@history_1066_li @history_1067_li
Theis Borg, Denmark Theis Borg, Denmark
@history_1067_li @history_1068_li
Joel A. Garringer, USA Joel A. Garringer, USA
@history_1068_li @history_1069_li
Olivier Chafik, France Olivier Chafik, France
@history_1069_li @history_1070_li
Rene Schwietzke, Germany Rene Schwietzke, Germany
@history_1070_li @history_1071_li
Jalpesh Patadia, USA Jalpesh Patadia, USA
@history_1071_li @history_1072_li
Takanori Kawashima, Japan Takanori Kawashima, Japan
@history_1072_li @history_1073_li
Terrence JC Huang, China Terrence JC Huang, China
@history_1073_a @history_1074_a
JiaDong Huang, Australia JiaDong Huang, Australia
@history_1074_li @history_1075_li
Laurent van Roy, Belgium Laurent van Roy, Belgium
@history_1076_li
Qian Chen, China
@installation_1000_h1 @installation_1000_h1
Installation Installation
...@@ -6673,6 +6724,237 @@ Features ...@@ -6673,6 +6724,237 @@ Features
@main_1007_p @main_1007_p
See what this database can do and how to use these features. See what this database can do and how to use these features.
@mvstore_1000_h1
MVStore
@mvstore_1001_a
Overview
@mvstore_1002_a
Example Code
@mvstore_1003_a
Features
@mvstore_1004_a
Similar Projects and Differences to Other Storage Engines
@mvstore_1005_a
Current State
@mvstore_1006_a
Building the MVStore Library
@mvstore_1007_a
Requirements
@mvstore_1008_h2
Overview
@mvstore_1009_p
The MVStore is work in progress, and is planned to be the next storage subsystem of H2.
@mvstore_1010_li
MVStore stands for multi-version store.
@mvstore_1011_li
Each store contains a number of maps (using the <code>java.util.Map</code> interface).
@mvstore_1012_li
The data can be persisted to disk (like a key-value store or a database).
@mvstore_1013_li
Fully in-memory operation is supported.
@mvstore_1014_li
It is intended to be fast, simple to use, and small.
@mvstore_1015_li
Old versions of the data can be read concurrently with all other operations.
@mvstore_1016_li
Transaction are supported (currently only one transaction at a time).
@mvstore_1017_li
Transactions (even if they are persisted) can be rolled back.
@mvstore_1018_li
The tool is very modular. It supports pluggable data types / serialization, pluggable map implementations (B-tree and R-tree currently), BLOB storage, and a file system abstraction to support encryption and compressed read-only files.
@mvstore_1019_h2
Example Code
@mvstore_1020_h3
Map Operations and Versioning
@mvstore_1021_p
The following sample code show how to create a store, open a map, add some data, and access the current and an old version.
@mvstore_1022_h3
Store Builder
@mvstore_1023_p
The <code>MVStoreBuilder</code> provides a fluid interface to build a store if more complex configuration options are used.
@mvstore_1024_h3
R-Tree
@mvstore_1025_p
The <code>MVRTreeMap</code> is an R-tree implementation that supports fast spatial queries.
@mvstore_1026_h2
Features
@mvstore_1027_h3
Maps
@mvstore_1028_p
Each store supports a set of named maps. A map is sorted by key, and supports the common lookup operations, including access to the first and last key, iterate over some or all keys, and so on.
@mvstore_1029_p
Also supported, and very uncommon for maps, is fast index lookup. The keys of the map can be accessed like a list (get the key at the given index, get the index of a certain key). That means getting the median of two keys is trivial, and it allows to very quickly count ranges. The iterator supports fast skipping. This is possible because internally, each map is organized in the form of a counted B+-tree.
@mvstore_1030_p
In database terms, a map can be used like a table, where the key of the map is the primary key of the table, and the value is the row. A map can also represent an index, where the key of the map is the key of the index, and the value of the map is the primary key of the table (for non-unique indexes the key of the map must also contain the primary key).
@mvstore_1031_h3
Versions / Transactions
@mvstore_1032_p
Multiple versions are supported. A version is a snapshot of all the data of all maps at a given point in time. A transaction is a number of actions between two versions.
@mvstore_1033_p
Versions / transactions are not immediately persisted; instead, only the version counter is incremented. If there is a change after switching to a new version, a snapshot of the old version is kept in memory, so that the old version can still be read.
@mvstore_1034_p
Old persisted versions are readable until the old data was explicitly overwritten. Creating the snapshot is fast: only the pages that are changed after a snapshot are copied. This behavior also called COW (copy on write).
@mvstore_1035_p
Rollback is supported (rollback to any old in-memory version or an old persisted version).
@mvstore_1036_h3
Log Structured Storage
@mvstore_1037_p
Currently, store() needs to be called explicitly to save changes. Changes are buffered in memory, and once enough changes have accumulated (for example 2 MB), all changes are written in one continuous disk write operation. But of course, if needed, changes can also be persisted if only little data was changed. The estimated amount of unsaved changes is tracked. The plan is to automatically store in a background thread once there are enough changes.
@mvstore_1038_p
When storing, all changed pages are serialized, compressed using the LZF algorithm (this can be disabled), and written sequentially to a free area of the file. Each such change set is called a chunk. All parent pages of the changed B-trees are stored in this chunk as well, so that each chunk also contains the root of each changed map (which is the entry point to read old data). There is no separate index: all data is stored as a list of pages.
@mvstore_1039_p
There are currently two write operations per chunk: one to store the chunk data (the pages), and one to update the file header (so it points to the chunk head), but the plan is to write the file header only once in a while, so it does not slow down opening the store too much.
@mvstore_1040_p
There is currently no transaction log, no undo log, and there are no in-place updates (however unused chunks are overwritten). To efficiently persist very small transactions, the plan is to support a transaction log where only the deltas is stored, until enough changes have accumulated to persist a chunk. Old versions are kept and are readable until they are no longer needed.
@mvstore_1041_p
The plan is to keep all old data for at least one or two minutes (configurable), so that there are no explicit sync operations required to guarantee data consistency. To reuse disk space, the chunks with the lowest amount of live data are compacted (the live data is simply stored again in the next chunk). To improve data locality and disk space usage, the plan is to automatically defragment and compact data.
@mvstore_1042_p
Compared to regular databases that use a transaction log, undo log, and main storage area, the log structured storage is simpler, more flexible, and typically needs less disk operations per change, as data is only written once instead of twice or 3 times, and because the B-tree pages are always full (they are stored next to each other) and can be easily compressed. But temporarily, disk space usage might actually be a bit higher than for a regular database, as disk space is not immediately re-used (there are no in-place updates).
@mvstore_1043_h3
In-Memory Performance and Usage
@mvstore_1044_p
Performance of in-memory operations is comparable with <code>java.util.TreeMap</code> (many operations are actually faster), but usually slower than <code>java.util.HashMap</code>.
@mvstore_1045_p
If no file name is specified, the store operates purely in memory. Except for persisting data, all features are supported in this mode (multi-versioning, index lookup, R-tree and so on).
@mvstore_1046_p
The memory overhead for large maps is slightly better than for the regular map implementations, but there is a higher overhead per map. For maps with less than 25 entries, the regular map implementations use less memory on average.
@mvstore_1047_h3
Pluggable Data Types
@mvstore_1048_p
Serialization is pluggable. The default serialization currently supports many common data types, and uses Java serialization for other objects. The following classes are currently directly supported: <code>Boolean, Byte, Short, Character, Integer, Long, Float, Double, BigInteger, BigDecimal, byte[], char[], int[], long[], String, UUID</code>. The plan is to add more common classes (date, time, timestamp, object array).
@mvstore_1049_p
Parameterized data types are supported (for example one could build a string data type that limits the length for some reason).
@mvstore_1050_p
The storage engine itself does not have any length limits, so that keys, values, pages, and chunks can be very big (as big as fits in memory). Also, there is no inherent limit to the number of maps and chunks. Due to using a log structured storage, there is no special case handling for large keys or pages.
@mvstore_1051_h3
BLOB Support
@mvstore_1052_p
There is a mechanism that stores large binary objects by splitting them into smaller blocks. This allows to store objects that don't fit in memory. Streaming as well as random access reads on such objects are supported. This tool is written on top of the store (only using the map interface).
@mvstore_1053_h3
R-Tree and Pluggable Map Implementations
@mvstore_1054_p
The map implementation is pluggable. In addition to the default MVMap (multi-version map), there is a multi-version R-tree map implementation for spatial operations (contain and intersection; nearest neighbor is not yet implemented).
@mvstore_1055_h3
Concurrent Operations and Caching
@mvstore_1056_p
At the moment, concurrent read on old versions of the data is supported. All such read operations can occur in parallel. Concurrent reads from the page cache, as well as concurrent reads from the file system are supported.
@mvstore_1057_p
Caching is done on the page level. The page cache is a concurrent LIRS cache, which should be resistant against scan operations.
@mvstore_1058_p
Concurrent modification operations on the maps are currently not supported, however it is planned to support an additional map implementation that supports concurrent writes (at the cost of speed if used in a single thread, same as <code>ConcurrentHashMap</code>).
@mvstore_1059_h3
File System Abstraction, File Locking and Online Backup
@mvstore_1060_p
The file system is pluggable (the same file system abstraction is used as H2 uses). Support for encryption is planned using an encrypting file system. Other file system implementations support reading from a compressed zip or tar file.
@mvstore_1061_p
Each store may only be opened once within a JVM. When opening a store, the file is locked in exclusive mode, so that the file can only be changed from within one process. Files can be opened in read-only mode, in which case a shared lock is used.
@mvstore_1062_p
The persisted data can be backed up to a different file at any time, even during write operations (online backup). To do that, automatic disk space reuse needs to be first disabled, so that new data is always appended at the end of the file. Then, the file can be copied (the file handle is available to the application).
@mvstore_1063_h3
Tools
@mvstore_1064_p
There is a builder for store instances (<code>MVStoreBuilder</code>) with a fluent API to simplify building a store instance.
@mvstore_1065_p
There is a tool (<code>MVStoreTool</code>) to dump the contents of a file.
@mvstore_1066_h2
Similar Projects and Differences to Other Storage Engines
@mvstore_1067_p
Unlike similar storage engines like LevelDB and Kyoto Cabinet, the MVStore is written in Java and can easily be embedded in a Java application.
@mvstore_1068_p
The MVStore is somewhat similar to the Berkeley DB Java Edition because it is also written in Java, and is also a log structured storage, but the H2 license is more liberal.
@mvstore_1069_p
Like SQLite, the MVStore keeps all data in one file. The plan is to make the MVStore easier to use and faster than SQLite on Android (this was not recently tested, however an initial test was successful).
@mvstore_1070_p
The API of the MVStore is similar to MapDB (previously known as JDBM) from Jan Kotek, and some code is shared between MapDB and JDBM. However, unlike MapDB, the MVStore uses is a log structured storage.
@mvstore_1071_h2
Current State
@mvstore_1072_p
The code is still very experimental at this stage. The API as well as the behavior will probably change. Features may be added and removed (even thought the main features will stay).
@mvstore_1073_h2
Building the MVStore Library
@mvstore_1074_p
There is currently no build script. To test it, run the test within the H2 project in Eclipse or any other IDE.
@mvstore_1075_h2
Requirements
@mvstore_1076_p
There are no special requirements. The MVStore should run on any JVM as well as on Android (even thought this was not tested recently).
@performance_1000_h1 @performance_1000_h1
Performance Performance
......
...@@ -1634,462 +1634,501 @@ Centralリポジトリの利用 ...@@ -1634,462 +1634,501 @@ Centralリポジトリの利用
#Next Version (unreleased) #Next Version (unreleased)
@changelog_1002_li @changelog_1002_li
#PostgreSQL compatibility: support for EXTRACT(WEEK FROM dateColumn). Thanks to Prashant Bhat for the patch! #Issue 407: The TriggerAdapter didn't work with CLOB and BLOB columns.
@changelog_1003_li @changelog_1003_li
#PostgreSQL compatibility: support for data types BIGSERIAL and SERIAL as an alias for AUTO_INCREMENT.
@changelog_1004_li
#Issue 417: H2 Console: the web session timeout didn't work, resulting in a memory leak. This was only a problem if the H2 Console was run for a long time and many sessions were opened.
@changelog_1005_li
#Issue 412: Running the Server tool with just the option "-browser" will now log a warning.
@changelog_1006_li
#Issue 411: CloseWatcher registration was not concurrency-safe.
@changelog_1007_li
#MySQL compatibility: support for CONCAT_WS. Thanks a lot to litailang for the patch!
@changelog_1008_li
#PostgreSQL compatibility: support for EXTRACT(WEEK FROM dateColumn). Thanks to Prashant Bhat for the patch!
@changelog_1009_li
#Fix for a bug where we would sometimes use the wrong unique constraint to validate foreign key constraints. #Fix for a bug where we would sometimes use the wrong unique constraint to validate foreign key constraints.
@changelog_1004_h2 @changelog_1010_li
#Support BOM at the beginning of files for the RUNSCRIPT command
@changelog_1011_li
#Fix in calling SET @X = IDENTITY() where it would return NULL incorrectly
@changelog_1012_li
#Fix ABBA deadlock between adding a constraint and the H2-Log-Writer thread.
@changelog_1013_li
#Optimize IN(...) queries where the values are constant and of the same type.
@changelog_1014_li
#Restore tool: the parameter "quiet" was not used and is now removed.
@changelog_1015_li
#Fix ConcurrentModificationException when creating tables and executing SHOW TABLES in parallel. Reported by Viktor Voytovych.
@changelog_1016_li
#Serialization is now pluggable using the system property "h2.javaObjectSerializer". Thanks to Sergi Vladykin for the patch!
@changelog_1017_h2
#Version 1.3.169 (2012-09-09) #Version 1.3.169 (2012-09-09)
@changelog_1005_li @changelog_1018_li
#The default jar file is now compiled for Java 6. #The default jar file is now compiled for Java 6.
@changelog_1006_li @changelog_1019_li
#The new jar file will probably not end up in the central Maven repository in the next few weeks because Sonatype has disabled automatic synchronization from SourceForge (which they call 'legacy sync' now). It will probably take some time until this is sorted out. The H2 jar files are deployed to http://h2database.com/m2-repo/com/h2database/h2/maven-metadata.xml and http://hsql.sourceforge.net/m2-repo/com/h2database/h2/maven-metadata.xml as usual. #The new jar file will probably not end up in the central Maven repository in the next few weeks because Sonatype has disabled automatic synchronization from SourceForge (which they call 'legacy sync' now). It will probably take some time until this is sorted out. The H2 jar files are deployed to http://h2database.com/m2-repo/com/h2database/h2/maven-metadata.xml and http://hsql.sourceforge.net/m2-repo/com/h2database/h2/maven-metadata.xml as usual.
@changelog_1007_li @changelog_1020_li
#A part of the documentation and the H2 Console has been changed to support the Apple retina display. #A part of the documentation and the H2 Console has been changed to support the Apple retina display.
@changelog_1008_li @changelog_1021_li
#The CreateCluster tool could not be used if the source database contained a CLOB or BLOB. The root cause was that the TCP server did not synchronize on the session, which caused a problem when using the exclusive mode. #The CreateCluster tool could not be used if the source database contained a CLOB or BLOB. The root cause was that the TCP server did not synchronize on the session, which caused a problem when using the exclusive mode.
@changelog_1009_li @changelog_1022_li
#Statement.getQueryTimeout(): only the first call to this method will query the database. If the query timeout was changed in another way than calling setQueryTimeout, this method will always return the last value. This was changed because Hibernate calls getQueryTimeout() a lot. #Statement.getQueryTimeout(): only the first call to this method will query the database. If the query timeout was changed in another way than calling setQueryTimeout, this method will always return the last value. This was changed because Hibernate calls getQueryTimeout() a lot.
@changelog_1010_li @changelog_1023_li
#Issue 416: PreparedStatement.setNString throws AbstractMethodError. All implemented JDBC 4 methods that don't break compatibility with Java 5 are now included in the default jar file. #Issue 416: PreparedStatement.setNString throws AbstractMethodError. All implemented JDBC 4 methods that don't break compatibility with Java 5 are now included in the default jar file.
@changelog_1011_li @changelog_1024_li
#Issue 414: for some functions, the parameters were evaluated twice (for example "char(nextval(..))" ran "nextval(..)" twice). #Issue 414: for some functions, the parameters were evaluated twice (for example "char(nextval(..))" ran "nextval(..)" twice).
@changelog_1012_li @changelog_1025_li
#The ResultSetMetaData methods getSchemaName and getTableName could return null instead of "" (an empty string) as specified in the JDBC API. #The ResultSetMetaData methods getSchemaName and getTableName could return null instead of "" (an empty string) as specified in the JDBC API.
@changelog_1013_li @changelog_1026_li
#Added compatibility for "SET NAMES" query in MySQL compatibility mode. #Added compatibility for "SET NAMES" query in MySQL compatibility mode.
@changelog_1014_h2 @changelog_1027_h2
#Version 1.3.168 (2012-07-13) #Version 1.3.168 (2012-07-13)
@changelog_1015_li @changelog_1028_li
#The message "Transaction log could not be truncated" was sometimes written to the .trace.db file even if there was no problem truncating the transaction log. #The message "Transaction log could not be truncated" was sometimes written to the .trace.db file even if there was no problem truncating the transaction log.
@changelog_1016_li @changelog_1029_li
#New system property "h2.serializeJavaObject" (default: true) that allows to disable serializing Java objects, so that the objects compareTo and toString methods can be used. #New system property "h2.serializeJavaObject" (default: true) that allows to disable serializing Java objects, so that the objects compareTo and toString methods can be used.
@changelog_1017_li @changelog_1030_li
#Dylan has translated the H2 Console tool to Korean. Thanks a lot! #Dylan has translated the H2 Console tool to Korean. Thanks a lot!
@changelog_1018_li @changelog_1031_li
#Executing the statement CREATE INDEX IF ALREADY EXISTS if the index already exists no longer fails for a read only database. #Executing the statement CREATE INDEX IF ALREADY EXISTS if the index already exists no longer fails for a read only database.
@changelog_1019_li @changelog_1032_li
#MVCC: concurrently updating a row could result in the row to appear deleted in the second connection, if there are multiple unique indexes (or a primary key and at least one unique index). Thanks a lot to Teruo for the patch! #MVCC: concurrently updating a row could result in the row to appear deleted in the second connection, if there are multiple unique indexes (or a primary key and at least one unique index). Thanks a lot to Teruo for the patch!
@changelog_1020_li @changelog_1033_li
#Fulltext search: in-memory Lucene indexes are now supported. #Fulltext search: in-memory Lucene indexes are now supported.
@changelog_1021_li @changelog_1034_li
#Fulltext search: UUID primary keys are now supported. #Fulltext search: UUID primary keys are now supported.
@changelog_1022_li @changelog_1035_li
#Apache Tomcat 7.x will now longer log a warning when unloading the web application, if using a connection pool. #Apache Tomcat 7.x will now longer log a warning when unloading the web application, if using a connection pool.
@changelog_1023_li @changelog_1036_li
#H2 Console: support the Midori browser (for Debian / Raspberry Pi) #H2 Console: support the Midori browser (for Debian / Raspberry Pi)
@changelog_1024_li @changelog_1037_li
#When opening a remote session, don't open a temporary file if the trace level is set to zero #When opening a remote session, don't open a temporary file if the trace level is set to zero
@changelog_1025_li @changelog_1038_li
#Use HMAC for authenticating remote LOB id's, removing the need for maintaining a cache, and removing the limit on the number of LOBs per result set. #Use HMAC for authenticating remote LOB id's, removing the need for maintaining a cache, and removing the limit on the number of LOBs per result set.
@changelog_1026_li @changelog_1039_li
#H2 Console: HTML and XML documents can now be edited in an updatable result set. There is (limited) support for editing multi-line documents. #H2 Console: HTML and XML documents can now be edited in an updatable result set. There is (limited) support for editing multi-line documents.
@changelog_1027_h2 @changelog_1040_h2
#Version 1.3.167 (2012-05-23) #Version 1.3.167 (2012-05-23)
@changelog_1028_li @changelog_1041_li
#H2 Console: when editing a row, an empty varchar column was replaced with a single space. #H2 Console: when editing a row, an empty varchar column was replaced with a single space.
@changelog_1029_li @changelog_1042_li
#Lukas Eder has updated the jOOQ documentation. #Lukas Eder has updated the jOOQ documentation.
@changelog_1030_li @changelog_1043_li
#Some nested joins could not be executed, for example: select * from (select * from (select * from a) a right join b b) c; #Some nested joins could not be executed, for example: select * from (select * from (select * from a) a right join b b) c;
@changelog_1031_li @changelog_1044_li
#MS SQL Server compatibility: ISNULL is now an alias for IFNULL. #MS SQL Server compatibility: ISNULL is now an alias for IFNULL.
@changelog_1032_li @changelog_1045_li
#Terrence Huang has completed the translation of the H2 Console tool to Chinese. Thanks a lot! #Terrence Huang has completed the translation of the H2 Console tool to Chinese. Thanks a lot!
@changelog_1033_li @changelog_1046_li
#Server mode: the number of CLOB / BLOB values that were cached on the server is now the maximum of: 5 times the SERVER_RESULT_SET_FETCH_SIZE (which is 100 by default), and SysProperties.SERVER_CACHED_OBJECTS. #Server mode: the number of CLOB / BLOB values that were cached on the server is now the maximum of: 5 times the SERVER_RESULT_SET_FETCH_SIZE (which is 100 by default), and SysProperties.SERVER_CACHED_OBJECTS.
@changelog_1034_li @changelog_1047_li
#In the trace file, the query execution time was incorrect in some cases, specially for the statement SET TRACE_LEVEL_FILE 2. #In the trace file, the query execution time was incorrect in some cases, specially for the statement SET TRACE_LEVEL_FILE 2.
@changelog_1035_li @changelog_1048_li
#The feature LOG_SIZE_LIMIT that was introduced in version 1.3.165 did not always work correctly (specially with regards to multithreading) and has been removed. The message "Transaction log could not be truncated" is still written to the .trace.db file if required. #The feature LOG_SIZE_LIMIT that was introduced in version 1.3.165 did not always work correctly (specially with regards to multithreading) and has been removed. The message "Transaction log could not be truncated" is still written to the .trace.db file if required.
@changelog_1036_li @changelog_1049_li
#Then reading from a resource using the prefix "classpath:", the ContextClassLoader is now used if the resource can't be read otherwise. #Then reading from a resource using the prefix "classpath:", the ContextClassLoader is now used if the resource can't be read otherwise.
@changelog_1037_li @changelog_1050_li
#DatabaseEventListener now calls setProgress whenever a statement starts and ends. #DatabaseEventListener now calls setProgress whenever a statement starts and ends.
@changelog_1038_li @changelog_1051_li
#DatabaseEventListener now calls setProgress periodically while a statement is running. #DatabaseEventListener now calls setProgress periodically while a statement is running.
@changelog_1039_li @changelog_1052_li
#The table INFORMATION_SCHEMA.FUNCTION_ALIASES now includes a column TYPE_NAME. #The table INFORMATION_SCHEMA.FUNCTION_ALIASES now includes a column TYPE_NAME.
@changelog_1040_li @changelog_1053_li
#Issue 378: when using views, the wrong values were bound to a parameter in some cases. #Issue 378: when using views, the wrong values were bound to a parameter in some cases.
@changelog_1041_li @changelog_1054_li
#Terrence Huang has translated the error messages to Chinese. Thanks a lot! #Terrence Huang has translated the error messages to Chinese. Thanks a lot!
@changelog_1042_li @changelog_1055_li
#TRUNC was added as an alias for TRUNCATE. #TRUNC was added as an alias for TRUNCATE.
@changelog_1043_li @changelog_1056_li
#Small optimisation for accessing result values by column name. #Small optimisation for accessing result values by column name.
@changelog_1044_li @changelog_1057_li
#Fix for bug in Statement.getMoreResults(int) #Fix for bug in Statement.getMoreResults(int)
@changelog_1045_li @changelog_1058_li
#The SCRIPT statements now supports filtering by schema and table. Thanks a lot to Jacob Qvortrup for providing the patch! #The SCRIPT statements now supports filtering by schema and table. Thanks a lot to Jacob Qvortrup for providing the patch!
@changelog_1046_h2 @changelog_1059_h2
#Version 1.3.166 (2012-04-08) #Version 1.3.166 (2012-04-08)
@changelog_1047_li @changelog_1060_li
#Indexes on column that are larger than half the page size (wide indexes) could sometimes get corrupt, resulting in an ArrayIndexOutOfBoundsException in PageBtree.getRow or "Row not found" in PageBtreeLeaf. Also, such indexes used too much disk space. #Indexes on column that are larger than half the page size (wide indexes) could sometimes get corrupt, resulting in an ArrayIndexOutOfBoundsException in PageBtree.getRow or "Row not found" in PageBtreeLeaf. Also, such indexes used too much disk space.
@changelog_1048_li @changelog_1061_li
#Server mode: when retrieving more than 64 rows each containing a CLOB or BLOB, the error message "The object is already closed" was thrown. #Server mode: when retrieving more than 64 rows each containing a CLOB or BLOB, the error message "The object is already closed" was thrown.
@changelog_1049_li @changelog_1062_li
#ConvertTraceFile: the time in the trace file is now parsed as a long. #ConvertTraceFile: the time in the trace file is now parsed as a long.
@changelog_1050_li @changelog_1063_li
#Invalid connection settings are now detected. #Invalid connection settings are now detected.
@changelog_1051_li @changelog_1064_li
#Issue 387: WHERE condition getting pushed into sub-query with LIMIT. #Issue 387: WHERE condition getting pushed into sub-query with LIMIT.
@changelog_1052_h2 @changelog_1065_h2
#Version 1.3.165 (2012-03-18) #Version 1.3.165 (2012-03-18)
@changelog_1053_li @changelog_1066_li
#Better string representation for decimal values (for example 0.00000000 instead of 0E-26). #Better string representation for decimal values (for example 0.00000000 instead of 0E-26).
@changelog_1054_li @changelog_1067_li
#Prepared statements could only be re-used if the same data types were used the second time they were executed. #Prepared statements could only be re-used if the same data types were used the second time they were executed.
@changelog_1055_li @changelog_1068_li
#In error messages about referential constraint violation, the values are now included. #In error messages about referential constraint violation, the values are now included.
@changelog_1056_li @changelog_1069_li
#SCRIPT and RUNSCRIPT: the password can now be set using a prepared statement. Previously, it was required to be a literal in the SQL statement. #SCRIPT and RUNSCRIPT: the password can now be set using a prepared statement. Previously, it was required to be a literal in the SQL statement.
@changelog_1057_li @changelog_1070_li
#MySQL compatibility: SUBSTR with a negative start index now works like MySQL. #MySQL compatibility: SUBSTR with a negative start index now works like MySQL.
@changelog_1058_li @changelog_1071_li
#When enabling autocommit, the transaction is now committed (as required by the JDBC API). #When enabling autocommit, the transaction is now committed (as required by the JDBC API).
@changelog_1059_li @changelog_1072_li
#The shell script <code>h2.sh</code> did not work with spaces in the path. It also works now with quoted spaces in the argument list. Thanks a lot to Shimizu Fumiyuki for the patch! #The shell script <code>h2.sh</code> did not work with spaces in the path. It also works now with quoted spaces in the argument list. Thanks a lot to Shimizu Fumiyuki for the patch!
@changelog_1060_li @changelog_1073_li
#If the transaction log could not be truncated because of an uncommitted transaction, now "Transaction log could not be truncated" is written to the .trace.db file. Before, the database file was growing and it was hard to find out what the root cause was. To avoid the database file from growing, a new feature to automatically rollback the oldest transaction is available now. To enable it, append ;LOG_SIZE_LIMIT=32 to the database URL (in that case, the oldest session is rolled back if the transaction log is 32 MB). #If the transaction log could not be truncated because of an uncommitted transaction, now "Transaction log could not be truncated" is written to the .trace.db file. Before, the database file was growing and it was hard to find out what the root cause was. To avoid the database file from growing, a new feature to automatically rollback the oldest transaction is available now. To enable it, append ;LOG_SIZE_LIMIT=32 to the database URL (in that case, the oldest session is rolled back if the transaction log is 32 MB).
@changelog_1061_li @changelog_1074_li
#ALTER TABLE ADD can now add more than one column at a time. #ALTER TABLE ADD can now add more than one column at a time.
@changelog_1062_li @changelog_1075_li
#Issue 380: ALTER TABLE ADD FOREIGN KEY with an explicit index didn't verify the index can be used, which would lead to a NullPointerException later on. #Issue 380: ALTER TABLE ADD FOREIGN KEY with an explicit index didn't verify the index can be used, which would lead to a NullPointerException later on.
@changelog_1063_li @changelog_1076_li
#Issue 384: the wrong kind of exception (NullPointerException) was thrown in a UNION query with an incorrect ORDER BY expression. #Issue 384: the wrong kind of exception (NullPointerException) was thrown in a UNION query with an incorrect ORDER BY expression.
@changelog_1064_li @changelog_1077_li
#Issue 362: support LIMIT in UPDATE statements. #Issue 362: support LIMIT in UPDATE statements.
@changelog_1065_li @changelog_1078_li
#Browser: if no default browser is set, Google Chrome is now used if available. If not available, then Konqueror, Netscape, or Opera is used if available (as before). #Browser: if no default browser is set, Google Chrome is now used if available. If not available, then Konqueror, Netscape, or Opera is used if available (as before).
@changelog_1066_li @changelog_1079_li
#CSV tool: new feature to disable writing the column header (option writeColumnHeader). #CSV tool: new feature to disable writing the column header (option writeColumnHeader).
@changelog_1067_li @changelog_1080_li
#CSV tool: new feature to preserve the case sensitivity of column names (option caseSensitiveColumnNames). #CSV tool: new feature to preserve the case sensitivity of column names (option caseSensitiveColumnNames).
@changelog_1068_li @changelog_1081_li
#PostgreSQL compatibility: LOG(x) is base 10 in the PostgreSQL mode. #PostgreSQL compatibility: LOG(x) is base 10 in the PostgreSQL mode.
@changelog_1069_h2 @changelog_1082_h2
#Version 1.3.164 (2012-02-03) #Version 1.3.164 (2012-02-03)
@changelog_1070_li @changelog_1083_li
#New built-in function ARRAY_CONTAINS. #New built-in function ARRAY_CONTAINS.
@changelog_1071_li @changelog_1084_li
#Some DatabaseMetaData methods didn't work when using ALLOW_LITERALS NONE. #Some DatabaseMetaData methods didn't work when using ALLOW_LITERALS NONE.
@changelog_1072_li @changelog_1085_li
#Trying to convert a VARCHAR to UUID will now fail if the text contains a character that is not a hex digit, '-', or not a whitespace. #Trying to convert a VARCHAR to UUID will now fail if the text contains a character that is not a hex digit, '-', or not a whitespace.
@changelog_1073_li @changelog_1086_li
#TriggerAdapter: in "before" triggers, values can be changed using the ResultSet.updateX methods. #TriggerAdapter: in "before" triggers, values can be changed using the ResultSet.updateX methods.
@changelog_1074_li @changelog_1087_li
#Creating a table with column data type NULL now works (even if not very useful). #Creating a table with column data type NULL now works (even if not very useful).
@changelog_1075_li @changelog_1088_li
#ALTER TABLE ALTER COLUMN no longer copies the data for widening conversions (for example if only the precision was increased) unless necessary. #ALTER TABLE ALTER COLUMN no longer copies the data for widening conversions (for example if only the precision was increased) unless necessary.
@changelog_1076_li @changelog_1089_li
#Multi-threaded kernel: concurrently running an online backup and updating the database resulted in a broken (transactionally incorrect) backup file in some cases. #Multi-threaded kernel: concurrently running an online backup and updating the database resulted in a broken (transactionally incorrect) backup file in some cases.
@changelog_1077_li @changelog_1090_li
#The script created by SCRIPT DROP did not always work if multiple views existed that depend on each other. #The script created by SCRIPT DROP did not always work if multiple views existed that depend on each other.
@changelog_1078_li @changelog_1091_li
#MathUtils.getSecureRandom could log a warning to System.err in case the /dev/random is very slow, and the System.getProperties().toString() returned a string larger than 64 KB. #MathUtils.getSecureRandom could log a warning to System.err in case the /dev/random is very slow, and the System.getProperties().toString() returned a string larger than 64 KB.
@changelog_1079_li @changelog_1092_li
#The database file locking mechanism "FS" (;FILE_LOCK=FS) did not work on Linux since version 1.3.161. #The database file locking mechanism "FS" (;FILE_LOCK=FS) did not work on Linux since version 1.3.161.
@changelog_1080_li @changelog_1093_li
#Sequences: the functions NEXTVAL and CURRVAL did not work as expected when using quoted, mixed case sequence names. #Sequences: the functions NEXTVAL and CURRVAL did not work as expected when using quoted, mixed case sequence names.
@changelog_1081_li @changelog_1094_li
#The constructor for Csv objects is now public, and Csv.getInstance() is now deprecated. #The constructor for Csv objects is now public, and Csv.getInstance() is now deprecated.
@changelog_1082_li @changelog_1095_li
#SimpleResultSet: updating a result set is now supported. #SimpleResultSet: updating a result set is now supported.
@changelog_1083_li @changelog_1096_li
#Database URL: extra semicolons are not supported. #Database URL: extra semicolons are not supported.
@changelog_1084_h2 @changelog_1097_h2
#Version 1.3.163 (2011-12-30) #Version 1.3.163 (2011-12-30)
@changelog_1085_li @changelog_1098_li
#On out of disk space, the database could get corrupt sometimes, if later write operations succeeded. The same problem happened on other kinds of I/O exceptions (where one or some of the writes fail, but subsequent writes succeed). Now the file is closed on the first unsuccessful write operation, so that later requests fail consistently. #On out of disk space, the database could get corrupt sometimes, if later write operations succeeded. The same problem happened on other kinds of I/O exceptions (where one or some of the writes fail, but subsequent writes succeed). Now the file is closed on the first unsuccessful write operation, so that later requests fail consistently.
@changelog_1086_li @changelog_1099_li
#DatabaseEventListener.diskSpaceIsLow() is no longer supported because it can't be guaranteed that it always works correctly. #DatabaseEventListener.diskSpaceIsLow() is no longer supported because it can't be guaranteed that it always works correctly.
@changelog_1087_li @changelog_1100_li
#XMLTEXT now supports an optional parameter to escape newlines. #XMLTEXT now supports an optional parameter to escape newlines.
@changelog_1088_li @changelog_1101_li
#XMLNODE now support an optional parameter to disable indentation. #XMLNODE now support an optional parameter to disable indentation.
@changelog_1089_li @changelog_1102_li
#Csv.write now formats date, time, and timestamp values using java.sql.Date / Time / Timestamp.toString(). Previously, ResultSet.getString() was used, which didn't work well for Oracle. #Csv.write now formats date, time, and timestamp values using java.sql.Date / Time / Timestamp.toString(). Previously, ResultSet.getString() was used, which didn't work well for Oracle.
@changelog_1090_li @changelog_1103_li
#The shell script <code>h2.sh</code> can now be run from within a different directory. Thanks a lot to Daniel Serodio for the patch! #The shell script <code>h2.sh</code> can now be run from within a different directory. Thanks a lot to Daniel Serodio for the patch!
@changelog_1091_li @changelog_1104_li
#The page size of a persistent database can now be queries using: select * from information_schema.settings where name = 'info.PAGE_SIZE' #The page size of a persistent database can now be queries using: select * from information_schema.settings where name = 'info.PAGE_SIZE'
@changelog_1092_li @changelog_1105_li
#In the server mode, BLOB and CLOB objects are no longer closed when the result set is closed (as required by the JDBC spec). #In the server mode, BLOB and CLOB objects are no longer closed when the result set is closed (as required by the JDBC spec).
@changelog_1093_h2 @changelog_1106_h2
#Version 1.3.162 (2011-11-26) #Version 1.3.162 (2011-11-26)
@changelog_1094_li @changelog_1107_li
#The following system properties are no longer supported: <code>h2.allowBigDecimalExtensions</code>, <code>h2.emptyPassword</code>, <code>h2.minColumnNameMap</code>, <code>h2.returnLobObjects</code>, <code>h2.webMaxValueLength</code>. #The following system properties are no longer supported: <code>h2.allowBigDecimalExtensions</code>, <code>h2.emptyPassword</code>, <code>h2.minColumnNameMap</code>, <code>h2.returnLobObjects</code>, <code>h2.webMaxValueLength</code>.
@changelog_1095_li @changelog_1108_li
#When using a VPN, starting a H2 server did not work (for some VPN software). #When using a VPN, starting a H2 server did not work (for some VPN software).
@changelog_1096_li @changelog_1109_li
#Oracle compatibility: support for DECODE(...). #Oracle compatibility: support for DECODE(...).
@changelog_1097_li @changelog_1110_li
#Lucene fulltext search: creating an index is now faster if the table already contains data. Thanks a lot to Angel Leon from the FrostWire Team for the patch! #Lucene fulltext search: creating an index is now faster if the table already contains data. Thanks a lot to Angel Leon from the FrostWire Team for the patch!
@changelog_1098_li @changelog_1111_li
#Update statements with a column list in brackets did not work if the list only contains one column. Example: update test set (id)=(id). #Update statements with a column list in brackets did not work if the list only contains one column. Example: update test set (id)=(id).
@changelog_1099_li @changelog_1112_li
#Read-only databases in a zip file did not work when using the -baseDir option. #Read-only databases in a zip file did not work when using the -baseDir option.
@changelog_1100_li @changelog_1113_li
#Issue 334: SimpleResultSet.getString now also works for Clob columns. #Issue 334: SimpleResultSet.getString now also works for Clob columns.
@changelog_1101_li @changelog_1114_li
#Subqueries with an aggregate did not always work. Example: select (select count(*) from test where a = t.a and b = 0) from test t group by a #Subqueries with an aggregate did not always work. Example: select (select count(*) from test where a = t.a and b = 0) from test t group by a
@changelog_1102_li @changelog_1115_li
#Server: in some (theoretical) cases, exceptions while closing the connection were ignored. #Server: in some (theoretical) cases, exceptions while closing the connection were ignored.
@changelog_1103_li @changelog_1116_li
#Server.createTcpServer, createPgServer, createWebServer: invalid arguments are now detected. #Server.createTcpServer, createPgServer, createWebServer: invalid arguments are now detected.
@changelog_1104_li @changelog_1117_li
#The selectivity of LOB columns is no longer calculated because indexes on LOB columns are not supported (however this should have little effect on performance, as the selectivity is calculated from the hash code and not the data). #The selectivity of LOB columns is no longer calculated because indexes on LOB columns are not supported (however this should have little effect on performance, as the selectivity is calculated from the hash code and not the data).
@changelog_1105_li @changelog_1118_li
#New experimental system property "h2.modifyOnWrite": when enabled, the database file is only modified when writing to the database. When enabled, the serialized file lock is much faster for read-only operations. #New experimental system property "h2.modifyOnWrite": when enabled, the database file is only modified when writing to the database. When enabled, the serialized file lock is much faster for read-only operations.
@changelog_1106_li @changelog_1119_li
#A NullPointerException could occur in TableView.isDeterministic for invalid views. #A NullPointerException could occur in TableView.isDeterministic for invalid views.
@changelog_1107_li @changelog_1120_li
#Issue 180: when deserializing objects, the context class loader is used instead of the default class loader if the system property "h2.useThreadContextClassLoader" is set. Thanks a lot to Noah Fontes for the patch! #Issue 180: when deserializing objects, the context class loader is used instead of the default class loader if the system property "h2.useThreadContextClassLoader" is set. Thanks a lot to Noah Fontes for the patch!
@changelog_1108_li @changelog_1121_li
#When using the exclusive mode, LOB operations could cause the thread to block. This also affected the CreateCluster tool (when using BLOB or CLOB data). #When using the exclusive mode, LOB operations could cause the thread to block. This also affected the CreateCluster tool (when using BLOB or CLOB data).
@changelog_1109_li @changelog_1122_li
#The optimization for "group by" was not working correctly if the group by column was aliased in the select list. #The optimization for "group by" was not working correctly if the group by column was aliased in the select list.
@changelog_1110_li @changelog_1123_li
#Issue 326: improved support for case sensitive (mixed case) identifiers without quotes when using DATABASE_TO_UPPER=FALSE. #Issue 326: improved support for case sensitive (mixed case) identifiers without quotes when using DATABASE_TO_UPPER=FALSE.
@changelog_1111_h2 @changelog_1124_h2
#Version 1.3.161 (2011-10-28) #Version 1.3.161 (2011-10-28)
@changelog_1112_li @changelog_1125_li
#Issue 351: MySQL mode: can not create a table with the column "KEY", and can not open databases where such a table already exists. #Issue 351: MySQL mode: can not create a table with the column "KEY", and can not open databases where such a table already exists.
@changelog_1113_li @changelog_1126_li
#TCP server: when using the trace option ("-trace"), the trace output contained unnecessary stack traces when stopping the server. #TCP server: when using the trace option ("-trace"), the trace output contained unnecessary stack traces when stopping the server.
@changelog_1114_li @changelog_1127_li
#Issue 354: when using the multi-threaded kernel option, and multiple threads concurrently prepared SQL statements that use the same view or the same index of a view, then in some cases an infinite loop could occur. #Issue 354: when using the multi-threaded kernel option, and multiple threads concurrently prepared SQL statements that use the same view or the same index of a view, then in some cases an infinite loop could occur.
@changelog_1115_li @changelog_1128_li
#Issue 350: when using instead of triggers, executeUpdate for delete operations always returned 0. #Issue 350: when using instead of triggers, executeUpdate for delete operations always returned 0.
@changelog_1116_li @changelog_1129_li
#Some timestamps with timezone were not converted correctly. For example, in the PST timezone, the timestamp 2011-10-26 08:00:00Z was converted to 2011-10-25 25:00:00 instead of 2011-10-26 01:00:00. Depending on the database operation, this caused subsequent error. #Some timestamps with timezone were not converted correctly. For example, in the PST timezone, the timestamp 2011-10-26 08:00:00Z was converted to 2011-10-25 25:00:00 instead of 2011-10-26 01:00:00. Depending on the database operation, this caused subsequent error.
@changelog_1117_li @changelog_1130_li
#Sequences with cache size smaller than 0 did not work correctly. #Sequences with cache size smaller than 0 did not work correctly.
@changelog_1118_li @changelog_1131_li
#Issue 356: for Blob objects, InputStream.skip() returned 0, causing EOFException in Blob.getBytes(.., ..). #Issue 356: for Blob objects, InputStream.skip() returned 0, causing EOFException in Blob.getBytes(.., ..).
@changelog_1119_li @changelog_1132_li
#Updatable result sets: if the value is not set when inserting a new row, the default value is now used (the same behavior as MySQL, PostgreSQL, and Apache Derby) instead of NULL. #Updatable result sets: if the value is not set when inserting a new row, the default value is now used (the same behavior as MySQL, PostgreSQL, and Apache Derby) instead of NULL.
@changelog_1120_li @changelog_1133_li
#Conditions of the form IN(SELECT ...) where slow and increased the database size if the subquery result size was larger then the configured MAX_MEMORY_ROWS. #Conditions of the form IN(SELECT ...) where slow and increased the database size if the subquery result size was larger then the configured MAX_MEMORY_ROWS.
@changelog_1121_li @changelog_1134_li
#Issue 347: the RunScript and Shell tools now ignore empty statements. #Issue 347: the RunScript and Shell tools now ignore empty statements.
@changelog_1122_li @changelog_1135_li
#Issue 246: improved error message for data conversion problems. #Issue 246: improved error message for data conversion problems.
@changelog_1123_li @changelog_1136_li
#Issue 344: the build now supports a custom Maven repository location. #Issue 344: the build now supports a custom Maven repository location.
@changelog_1124_li @changelog_1137_li
#Issue 334: Java functions that return CLOB or BLOB objects could not be used as tables. #Issue 334: Java functions that return CLOB or BLOB objects could not be used as tables.
@changelog_1125_li @changelog_1138_li
#SimpleResultSet now supports getColumnTypeName and getColumnClassName. #SimpleResultSet now supports getColumnTypeName and getColumnClassName.
@changelog_1126_li @changelog_1139_li
#SimpleResultSet now has minimal BLOB and CLOB support. #SimpleResultSet now has minimal BLOB and CLOB support.
@changelog_1127_li @changelog_1140_li
#Improved performance for large databases (many GB), and databases with a small page size. #Improved performance for large databases (many GB), and databases with a small page size.
@changelog_1128_li @changelog_1141_li
#The Polish translation has been improved by Jaros&#322;aw Kokoci&#324;ski. #The Polish translation has been improved by Jaros&#322;aw Kokoci&#324;ski.
@changelog_1129_li @changelog_1142_li
#When using the built-in connection pool, after calling the "shutdown" SQL statement, a warning was written to the .trace.db file about an unclosed connection. #When using the built-in connection pool, after calling the "shutdown" SQL statement, a warning was written to the .trace.db file about an unclosed connection.
@changelog_1130_li @changelog_1143_li
#Improved compatibility for "fetch first / next row(s)". Thanks a lot to litailang for the patch! #Improved compatibility for "fetch first / next row(s)". Thanks a lot to litailang for the patch!
@changelog_1131_li @changelog_1144_li
#Improved compatibility with the Java 7 FileSystem abstraction. #Improved compatibility with the Java 7 FileSystem abstraction.
@changelog_1132_h2 @changelog_1145_h2
#Version 1.3.160 (2011-09-11) #Version 1.3.160 (2011-09-11)
@changelog_1133_li @changelog_1146_li
#Computed columns could not refer to itself. #Computed columns could not refer to itself.
@changelog_1134_li @changelog_1147_li
#Issue 340: Comparison with "x = all(select ...)" or similar in a view or subquery that was used as a table returned the wrong result. #Issue 340: Comparison with "x = all(select ...)" or similar in a view or subquery that was used as a table returned the wrong result.
@changelog_1135_li @changelog_1148_li
#Comparison with "x = all(select ...)" or similar returned the wrong result for some cases (for example if the subquery returned no rows, or multiple rows with the same value, or null, or if x was null). #Comparison with "x = all(select ...)" or similar returned the wrong result for some cases (for example if the subquery returned no rows, or multiple rows with the same value, or null, or if x was null).
@changelog_1136_li @changelog_1149_li
#Issue 335: Could not run DROP ALL OBJECTS DELETE FILES on older databases with CLOB or BLOB data. The problem was that the metadata table was not locked in some cases, so that a rollback could result in a corrupt database in a database if the lob storage was upgraded. #Issue 335: Could not run DROP ALL OBJECTS DELETE FILES on older databases with CLOB or BLOB data. The problem was that the metadata table was not locked in some cases, so that a rollback could result in a corrupt database in a database if the lob storage was upgraded.
@changelog_1137_li @changelog_1150_li
#Source code switching using //## has been simplified. The Java 1.5 tag has been removed because is no longer needed. #Source code switching using //## has been simplified. The Java 1.5 tag has been removed because is no longer needed.
@changelog_1138_li @changelog_1151_li
#The JDBC methods PreparedStatement.setTimestamp, setTime, and setDate with a calendar, and the methods ResultSet.getTimestamp, getTime, and getDate with a calendar converted the value in the wrong way, so that for some timestamps the converted value was wrong (where summertime starts, one hour per year). #The JDBC methods PreparedStatement.setTimestamp, setTime, and setDate with a calendar, and the methods ResultSet.getTimestamp, getTime, and getDate with a calendar converted the value in the wrong way, so that for some timestamps the converted value was wrong (where summertime starts, one hour per year).
@changelog_1139_li @changelog_1152_li
#Invalid tables names in 'order by' columns were not detected in some cases. Example: select x from dual order by y.x #Invalid tables names in 'order by' columns were not detected in some cases. Example: select x from dual order by y.x
@changelog_1140_li @changelog_1153_li
#Issue 329: CASE expression: data type problem is not detected. #Issue 329: CASE expression: data type problem is not detected.
@changelog_1141_li @changelog_1154_li
#Issue 311: File lock mode serialized: selecting the next value from a sequence didn't work after a pause, because the database thought this is a read-only operation. #Issue 311: File lock mode serialized: selecting the next value from a sequence didn't work after a pause, because the database thought this is a read-only operation.
@changelog_1142_h2 @changelog_1155_h2
#Version 1.3.159 (2011-08-13) #Version 1.3.159 (2011-08-13)
@changelog_1143_li @changelog_1156_li
#Creating a temporary table with the option 'transactional' will now also create the indexes in transactional mode, if the indexes are included in the 'create table' statement as follows: "create local temporary table temp(id int primary key, name varchar, constraint x index(name)) transactional". #Creating a temporary table with the option 'transactional' will now also create the indexes in transactional mode, if the indexes are included in the 'create table' statement as follows: "create local temporary table temp(id int primary key, name varchar, constraint x index(name)) transactional".
@changelog_1144_li @changelog_1157_li
#The database file size grows now 35%, but at most 256 MB at a time. #The database file size grows now 35%, but at most 256 MB at a time.
@changelog_1145_li @changelog_1158_li
#Improved error message on network configuration problems. #Improved error message on network configuration problems.
@changelog_1146_li @changelog_1159_li
#The build now support an offline build using ./build.sh offline. This will list the required dependencies if jar files are missing. #The build now support an offline build using ./build.sh offline. This will list the required dependencies if jar files are missing.
@changelog_1147_li @changelog_1160_li
#The BLOB / CLOB data was dropped a little bit before the table was dropped. This could cause "lob not found" errors when the process was killed while a table was dropped. #The BLOB / CLOB data was dropped a little bit before the table was dropped. This could cause "lob not found" errors when the process was killed while a table was dropped.
@changelog_1148_li @changelog_1161_li
#"group_concat(distinct ...)" did not work correctly in a view or subquery (the 'distinct' was lost). Example: select * from (select group_concat(distinct 1) from system_range(1, 3)); #"group_concat(distinct ...)" did not work correctly in a view or subquery (the 'distinct' was lost). Example: select * from (select group_concat(distinct 1) from system_range(1, 3));
@changelog_1149_li @changelog_1162_li
#Database URLs can now be re-mapped to another URL using the system property "h2.urlMap", which points to a properties file with database URL mappings. #Database URLs can now be re-mapped to another URL using the system property "h2.urlMap", which points to a properties file with database URL mappings.
@changelog_1150_li @changelog_1163_li
#When using InputStream.skip, trying to read past the end of a BLOB failed with the exception "IO Exception: Missing lob entry: ..." [90028-...]. #When using InputStream.skip, trying to read past the end of a BLOB failed with the exception "IO Exception: Missing lob entry: ..." [90028-...].
@changelog_1151_li @changelog_1164_li
#The in-memory file system "memFS:" now has limited support for directories. #The in-memory file system "memFS:" now has limited support for directories.
@changelog_1152_li @changelog_1165_li
#To test recovery, append ;RECOVER_TEST=64 to the database URL. This will simulate an application crash after each 64 writes to the database file. A log file named databaseName.h2.db.log is created that lists the operations. The recovery is tested using an in-memory file system, that means it may require a larger heap setting. #To test recovery, append ;RECOVER_TEST=64 to the database URL. This will simulate an application crash after each 64 writes to the database file. A log file named databaseName.h2.db.log is created that lists the operations. The recovery is tested using an in-memory file system, that means it may require a larger heap setting.
@changelog_1153_li @changelog_1166_li
#Converting a hex string to a byte array is now faster. #Converting a hex string to a byte array is now faster.
@changelog_1154_li @changelog_1167_li
#The SQL statement "shutdown defrag" could corrupt the database if the process was killed while the shutdown was in progress. The same problem could occur when the database setting "defrag_always" was used. #The SQL statement "shutdown defrag" could corrupt the database if the process was killed while the shutdown was in progress. The same problem could occur when the database setting "defrag_always" was used.
@cheatSheet_1000_h1 @cheatSheet_1000_h1
...@@ -2501,87 +2540,90 @@ F A Q ...@@ -2501,87 +2540,90 @@ F A Q
#The PostgreSQL server #The PostgreSQL server
@faq_1059_li @faq_1059_li
#Multi-threading within the engine using <code>SET MULTI_THREADED=1</code>. #Clustering (there are cases were transaction isolation can be broken due to timing issues, for example one session overtaking another session).
@faq_1060_li @faq_1060_li
#Compatibility modes for other databases (only some features are implemented). #Multi-threading within the engine using <code>SET MULTI_THREADED=1</code>.
@faq_1061_li @faq_1061_li
#Compatibility modes for other databases (only some features are implemented).
@faq_1062_li
#The soft reference cache (<code>CACHE_TYPE=SOFT_LRU</code>). It might not improve performance, and out of memory issues have been reported. #The soft reference cache (<code>CACHE_TYPE=SOFT_LRU</code>). It might not improve performance, and out of memory issues have been reported.
@faq_1062_p @faq_1063_p
# Some users have reported that after a power failure, the database cannot be opened sometimes. In this case, use a backup of the database or the Recover tool. Please report such problems. The plan is that the database automatically recovers in all situations. # Some users have reported that after a power failure, the database cannot be opened sometimes. In this case, use a backup of the database or the Recover tool. Please report such problems. The plan is that the database automatically recovers in all situations.
@faq_1063_h3 @faq_1064_h3
#Why is Opening my Database Slow? #Why is Opening my Database Slow?
@faq_1064_p @faq_1065_p
# To find out what the problem is, use the H2 Console and click on "Test Connection" instead of "Login". After the "Login Successful" appears, click on it (it's a link). This will list the top stack traces. Then either analyze this yourself, or post those stack traces in the Google Group. # To find out what the problem is, use the H2 Console and click on "Test Connection" instead of "Login". After the "Login Successful" appears, click on it (it's a link). This will list the top stack traces. Then either analyze this yourself, or post those stack traces in the Google Group.
@faq_1065_p @faq_1066_p
# Other possible reasons are: the database is very big (many GB), or contains linked tables that are slow to open. # Other possible reasons are: the database is very big (many GB), or contains linked tables that are slow to open.
@faq_1066_h3 @faq_1067_h3
#My Query is Slow #My Query is Slow
@faq_1067_p @faq_1068_p
# Slow <code>SELECT</code> (or <code>DELETE, UPDATE, MERGE</code>) statement can have multiple reasons. Follow this checklist: # Slow <code>SELECT</code> (or <code>DELETE, UPDATE, MERGE</code>) statement can have multiple reasons. Follow this checklist:
@faq_1068_li @faq_1069_li
#Run <code>ANALYZE</code> (see documentation for details). #Run <code>ANALYZE</code> (see documentation for details).
@faq_1069_li @faq_1070_li
#Run the query with <code>EXPLAIN</code> and check if indexes are used (see documentation for details). #Run the query with <code>EXPLAIN</code> and check if indexes are used (see documentation for details).
@faq_1070_li @faq_1071_li
#If required, create additional indexes and try again using <code>ANALYZE</code> and <code>EXPLAIN</code>. #If required, create additional indexes and try again using <code>ANALYZE</code> and <code>EXPLAIN</code>.
@faq_1071_li @faq_1072_li
#If it doesn't help please report the problem. #If it doesn't help please report the problem.
@faq_1072_h3 @faq_1073_h3
#H2 is Very Slow #H2 is Very Slow
@faq_1073_p @faq_1074_p
# By default, H2 closes the database when the last connection is closed. If your application closes the only connection after each operation, the database is opened and closed a lot, which is quite slow. There are multiple ways to solve this problem, see <a href="performance.html#database_performance_tuning">Database Performance Tuning</a>. # By default, H2 closes the database when the last connection is closed. If your application closes the only connection after each operation, the database is opened and closed a lot, which is quite slow. There are multiple ways to solve this problem, see <a href="performance.html#database_performance_tuning">Database Performance Tuning</a>.
@faq_1074_h3 @faq_1075_h3
#Column Names are Incorrect? #Column Names are Incorrect?
@faq_1075_p @faq_1076_p
# For the query <code>SELECT ID AS X FROM TEST</code> the method <code>ResultSetMetaData.getColumnName()</code> returns <code>ID</code>, I expect it to return <code>X</code>. What's wrong? # For the query <code>SELECT ID AS X FROM TEST</code> the method <code>ResultSetMetaData.getColumnName()</code> returns <code>ID</code>, I expect it to return <code>X</code>. What's wrong?
@faq_1076_p @faq_1077_p
# This is not a bug. According the the JDBC specification, the method <code>ResultSetMetaData.getColumnName()</code> should return the name of the column and not the alias name. If you need the alias name, use <a href="http://java.sun.com/javase/6/docs/api/java/sql/ResultSetMetaData.html#getColumnLabel(int)"><code>ResultSetMetaData.getColumnLabel()</code></a>. Some other database don't work like this yet (they don't follow the JDBC specification). If you need compatibility with those databases, use the <a href="features.html#compatibility">Compatibility Mode</a>, or append <a href="../javadoc/org/h2/constant/DbSettings.html#ALIAS_COLUMN_NAME"><code>;ALIAS_COLUMN_NAME=TRUE</code></a> to the database URL. # This is not a bug. According the the JDBC specification, the method <code>ResultSetMetaData.getColumnName()</code> should return the name of the column and not the alias name. If you need the alias name, use <a href="http://java.sun.com/javase/6/docs/api/java/sql/ResultSetMetaData.html#getColumnLabel(int)"><code>ResultSetMetaData.getColumnLabel()</code></a>. Some other database don't work like this yet (they don't follow the JDBC specification). If you need compatibility with those databases, use the <a href="features.html#compatibility">Compatibility Mode</a>, or append <a href="../javadoc/org/h2/constant/DbSettings.html#ALIAS_COLUMN_NAME"><code>;ALIAS_COLUMN_NAME=TRUE</code></a> to the database URL.
@faq_1077_p @faq_1078_p
# This also applies to DatabaseMetaData calls that return a result set. The columns in the JDBC API are column labels, not column names. # This also applies to DatabaseMetaData calls that return a result set. The columns in the JDBC API are column labels, not column names.
@faq_1078_h3 @faq_1079_h3
#Float is Double? #Float is Double?
@faq_1079_p @faq_1080_p
# For a table defined as <code>CREATE TABLE TEST(X FLOAT)</code> the method <code>ResultSet.getObject()</code> returns a <code>java.lang.Double</code>, I expect it to return a <code>java.lang.Float</code>. What's wrong? # For a table defined as <code>CREATE TABLE TEST(X FLOAT)</code> the method <code>ResultSet.getObject()</code> returns a <code>java.lang.Double</code>, I expect it to return a <code>java.lang.Float</code>. What's wrong?
@faq_1080_p @faq_1081_p
# This is not a bug. According the the JDBC specification, the JDBC data type <code>FLOAT</code> is equivalent to <code>DOUBLE</code>, and both are mapped to <code>java.lang.Double</code>. See also <a href="http://java.sun.com/j2se/1.5.0/docs/guide/jdbc/getstart/mapping.html#1055162"> Mapping SQL and Java Types - 8.3.10 FLOAT</a>. # This is not a bug. According the the JDBC specification, the JDBC data type <code>FLOAT</code> is equivalent to <code>DOUBLE</code>, and both are mapped to <code>java.lang.Double</code>. See also <a href="http://java.sun.com/j2se/1.5.0/docs/guide/jdbc/getstart/mapping.html#1055162"> Mapping SQL and Java Types - 8.3.10 FLOAT</a>.
@faq_1081_h3 @faq_1082_h3
#Is the GCJ Version Stable? Faster? #Is the GCJ Version Stable? Faster?
@faq_1082_p @faq_1083_p
# The GCJ version is not as stable as the Java version. When running the regression test with the GCJ version, sometimes the application just stops at what seems to be a random point without error message. Currently, the GCJ version is also slower than when using the Sun VM. However, the startup of the GCJ version is faster than when using a VM. # The GCJ version is not as stable as the Java version. When running the regression test with the GCJ version, sometimes the application just stops at what seems to be a random point without error message. Currently, the GCJ version is also slower than when using the Sun VM. However, the startup of the GCJ version is faster than when using a VM.
@faq_1083_h3 @faq_1084_h3
このプロジェクトの翻訳方法は? このプロジェクトの翻訳方法は?
@faq_1084_p @faq_1085_p
# For more information, see <a href="build.html#translating">Build/Translating</a>. # For more information, see <a href="build.html#translating">Build/Translating</a>.
@faq_1085_h3 @faq_1086_h3
#How to Contribute to this Project? #How to Contribute to this Project?
@faq_1086_p @faq_1087_p
# There are various way to help develop an open source project like H2. The first step could be to <a href="build.html#translating">translate</a> the error messages and the GUI to your native language. Then, you could <a href="build.html#providing_patches">provide patches</a>. Please start with small patches. That could be adding a test case to improve the <a href="build.html#automated">code coverage</a> (the target code coverage for this project is 90%, higher is better). You will have to <a href="build.html">develop, build and run the tests</a>. Once you are familiar with the code, you could implement missing features from the <a href="roadmap.html">feature request list</a>. I suggest to start with very small features that are easy to implement. Keep in mind to provide test cases as well. # There are various way to help develop an open source project like H2. The first step could be to <a href="build.html#translating">translate</a> the error messages and the GUI to your native language. Then, you could <a href="build.html#providing_patches">provide patches</a>. Please start with small patches. That could be adding a test case to improve the <a href="build.html#automated">code coverage</a> (the target code coverage for this project is 90%, higher is better). You will have to <a href="build.html">develop, build and run the tests</a>. Once you are familiar with the code, you could implement missing features from the <a href="roadmap.html">feature request list</a>. I suggest to start with very small features that are easy to implement. Keep in mind to provide test cases as well.
@features_1000_h1 @features_1000_h1
...@@ -4501,7 +4543,10 @@ SimpleResultSetを使用する ...@@ -4501,7 +4543,10 @@ SimpleResultSetを使用する
@fragments_1030_a @fragments_1030_a
#JaQu #JaQu
@fragments_1031_td @fragments_1031_a
#MVStore
@fragments_1032_td
&nbsp; &nbsp;
@frame_1000_h1 @frame_1000_h1
...@@ -4640,128 +4685,134 @@ H2 データベース エンジン ...@@ -4640,128 +4685,134 @@ H2 データベース エンジン
#Eckenfelder GmbH & Co.KG, Germany #Eckenfelder GmbH & Co.KG, Germany
@history_1034_li @history_1034_li
#Alessio Jacopo D'Adamo, Italy #Richard Hickey, USA
@history_1035_li @history_1035_li
#Ashwin Jayaprakash, USA #Alessio Jacopo D'Adamo, Italy
@history_1036_li @history_1036_li
#Donald Bleyl, USA #Ashwin Jayaprakash, USA
@history_1037_li @history_1037_li
#Frank Berger, Germany #Donald Bleyl, USA
@history_1038_li @history_1038_li
#Florent Ramiere, France #Frank Berger, Germany
@history_1039_li @history_1039_li
#Jun Iyama, Japan #Florent Ramiere, France
@history_1040_li @history_1040_li
#Antonio Casqueiro, Portugal #Jun Iyama, Japan
@history_1041_li @history_1041_li
#Oliver Computing LLC, USA #Antonio Casqueiro, Portugal
@history_1042_li @history_1042_li
#Harpal Grover Consulting Inc., USA #Oliver Computing LLC, USA
@history_1043_li @history_1043_li
#Elisabetta Berlini, Italy #Harpal Grover Consulting Inc., USA
@history_1044_li @history_1044_li
#William Gilbert, USA #Elisabetta Berlini, Italy
@history_1045_li @history_1045_li
#William Gilbert, USA
@history_1046_li
#Antonio Dieguez Rojas, Chile #Antonio Dieguez Rojas, Chile
@history_1046_a @history_1047_a
#Ontology Works, USA #Ontology Works, USA
@history_1047_li @history_1048_li
#Pete Haidinyak, USA #Pete Haidinyak, USA
@history_1048_li @history_1049_li
#William Osmond, USA #William Osmond, USA
@history_1049_li @history_1050_li
#Joachim Ansorg, Germany #Joachim Ansorg, Germany
@history_1050_li @history_1051_li
#Oliver Soerensen, Germany #Oliver Soerensen, Germany
@history_1051_li @history_1052_li
#Christos Vasilakis, Greece #Christos Vasilakis, Greece
@history_1052_li @history_1053_li
#Fyodor Kupolov, Denmark #Fyodor Kupolov, Denmark
@history_1053_li @history_1054_li
#Jakob Jenkov, Denmark #Jakob Jenkov, Denmark
@history_1054_li @history_1055_li
#St&eacute;phane Chartrand, Switzerland #St&eacute;phane Chartrand, Switzerland
@history_1055_li @history_1056_li
#Glenn Kidd, USA #Glenn Kidd, USA
@history_1056_li @history_1057_li
#Gustav Trede, Sweden #Gustav Trede, Sweden
@history_1057_li @history_1058_li
#Joonas Pulakka, Finland #Joonas Pulakka, Finland
@history_1058_li @history_1059_li
#Bjorn Darri Sigurdsson, Iceland #Bjorn Darri Sigurdsson, Iceland
@history_1059_li @history_1060_li
#Iyama Jun, Japan #Iyama Jun, Japan
@history_1060_li @history_1061_li
#Gray Watson, USA #Gray Watson, USA
@history_1061_li @history_1062_li
#Erik Dick, Germany #Erik Dick, Germany
@history_1062_li @history_1063_li
#Pengxiang Shao, China #Pengxiang Shao, China
@history_1063_li @history_1064_li
#Bilingual Marketing Group, USA #Bilingual Marketing Group, USA
@history_1064_li @history_1065_li
#Philippe Marschall, Switzerland #Philippe Marschall, Switzerland
@history_1065_li @history_1066_li
#Knut Staring, Norway #Knut Staring, Norway
@history_1066_li @history_1067_li
#Theis Borg, Denmark #Theis Borg, Denmark
@history_1067_li @history_1068_li
#Joel A. Garringer, USA #Joel A. Garringer, USA
@history_1068_li @history_1069_li
#Olivier Chafik, France #Olivier Chafik, France
@history_1069_li @history_1070_li
#Rene Schwietzke, Germany #Rene Schwietzke, Germany
@history_1070_li @history_1071_li
#Jalpesh Patadia, USA #Jalpesh Patadia, USA
@history_1071_li @history_1072_li
#Takanori Kawashima, Japan #Takanori Kawashima, Japan
@history_1072_li @history_1073_li
#Terrence JC Huang, China #Terrence JC Huang, China
@history_1073_a @history_1074_a
#JiaDong Huang, Australia #JiaDong Huang, Australia
@history_1074_li @history_1075_li
#Laurent van Roy, Belgium #Laurent van Roy, Belgium
@history_1076_li
#Qian Chen, China
@installation_1000_h1 @installation_1000_h1
インストール インストール
...@@ -6673,6 +6724,237 @@ H2 データベース エンジン ...@@ -6673,6 +6724,237 @@ H2 データベース エンジン
@main_1007_p @main_1007_p
# See what this database can do and how to use these features. # See what this database can do and how to use these features.
@mvstore_1000_h1
#MVStore
@mvstore_1001_a
# Overview
@mvstore_1002_a
# Example Code
@mvstore_1003_a
# Features
@mvstore_1004_a
# Similar Projects and Differences to Other Storage Engines
@mvstore_1005_a
# Current State
@mvstore_1006_a
# Building the MVStore Library
@mvstore_1007_a
# Requirements
@mvstore_1008_h2
#Overview
@mvstore_1009_p
# The MVStore is work in progress, and is planned to be the next storage subsystem of H2.
@mvstore_1010_li
#MVStore stands for multi-version store.
@mvstore_1011_li
#Each store contains a number of maps (using the <code>java.util.Map</code> interface).
@mvstore_1012_li
#The data can be persisted to disk (like a key-value store or a database).
@mvstore_1013_li
#Fully in-memory operation is supported.
@mvstore_1014_li
#It is intended to be fast, simple to use, and small.
@mvstore_1015_li
#Old versions of the data can be read concurrently with all other operations.
@mvstore_1016_li
#Transaction are supported (currently only one transaction at a time).
@mvstore_1017_li
#Transactions (even if they are persisted) can be rolled back.
@mvstore_1018_li
#The tool is very modular. It supports pluggable data types / serialization, pluggable map implementations (B-tree and R-tree currently), BLOB storage, and a file system abstraction to support encryption and compressed read-only files.
@mvstore_1019_h2
#Example Code
@mvstore_1020_h3
#Map Operations and Versioning
@mvstore_1021_p
# The following sample code show how to create a store, open a map, add some data, and access the current and an old version.
@mvstore_1022_h3
#Store Builder
@mvstore_1023_p
# The <code>MVStoreBuilder</code> provides a fluid interface to build a store if more complex configuration options are used.
@mvstore_1024_h3
#R-Tree
@mvstore_1025_p
# The <code>MVRTreeMap</code> is an R-tree implementation that supports fast spatial queries.
@mvstore_1026_h2
特徴
@mvstore_1027_h3
#Maps
@mvstore_1028_p
# Each store supports a set of named maps. A map is sorted by key, and supports the common lookup operations, including access to the first and last key, iterate over some or all keys, and so on.
@mvstore_1029_p
# Also supported, and very uncommon for maps, is fast index lookup. The keys of the map can be accessed like a list (get the key at the given index, get the index of a certain key). That means getting the median of two keys is trivial, and it allows to very quickly count ranges. The iterator supports fast skipping. This is possible because internally, each map is organized in the form of a counted B+-tree.
@mvstore_1030_p
# In database terms, a map can be used like a table, where the key of the map is the primary key of the table, and the value is the row. A map can also represent an index, where the key of the map is the key of the index, and the value of the map is the primary key of the table (for non-unique indexes the key of the map must also contain the primary key).
@mvstore_1031_h3
#Versions / Transactions
@mvstore_1032_p
# Multiple versions are supported. A version is a snapshot of all the data of all maps at a given point in time. A transaction is a number of actions between two versions.
@mvstore_1033_p
# Versions / transactions are not immediately persisted; instead, only the version counter is incremented. If there is a change after switching to a new version, a snapshot of the old version is kept in memory, so that the old version can still be read.
@mvstore_1034_p
# Old persisted versions are readable until the old data was explicitly overwritten. Creating the snapshot is fast: only the pages that are changed after a snapshot are copied. This behavior also called COW (copy on write).
@mvstore_1035_p
# Rollback is supported (rollback to any old in-memory version or an old persisted version).
@mvstore_1036_h3
#Log Structured Storage
@mvstore_1037_p
# Currently, store() needs to be called explicitly to save changes. Changes are buffered in memory, and once enough changes have accumulated (for example 2 MB), all changes are written in one continuous disk write operation. But of course, if needed, changes can also be persisted if only little data was changed. The estimated amount of unsaved changes is tracked. The plan is to automatically store in a background thread once there are enough changes.
@mvstore_1038_p
# When storing, all changed pages are serialized, compressed using the LZF algorithm (this can be disabled), and written sequentially to a free area of the file. Each such change set is called a chunk. All parent pages of the changed B-trees are stored in this chunk as well, so that each chunk also contains the root of each changed map (which is the entry point to read old data). There is no separate index: all data is stored as a list of pages.
@mvstore_1039_p
# There are currently two write operations per chunk: one to store the chunk data (the pages), and one to update the file header (so it points to the chunk head), but the plan is to write the file header only once in a while, so it does not slow down opening the store too much.
@mvstore_1040_p
# There is currently no transaction log, no undo log, and there are no in-place updates (however unused chunks are overwritten). To efficiently persist very small transactions, the plan is to support a transaction log where only the deltas is stored, until enough changes have accumulated to persist a chunk. Old versions are kept and are readable until they are no longer needed.
@mvstore_1041_p
# The plan is to keep all old data for at least one or two minutes (configurable), so that there are no explicit sync operations required to guarantee data consistency. To reuse disk space, the chunks with the lowest amount of live data are compacted (the live data is simply stored again in the next chunk). To improve data locality and disk space usage, the plan is to automatically defragment and compact data.
@mvstore_1042_p
# Compared to regular databases that use a transaction log, undo log, and main storage area, the log structured storage is simpler, more flexible, and typically needs less disk operations per change, as data is only written once instead of twice or 3 times, and because the B-tree pages are always full (they are stored next to each other) and can be easily compressed. But temporarily, disk space usage might actually be a bit higher than for a regular database, as disk space is not immediately re-used (there are no in-place updates).
@mvstore_1043_h3
#In-Memory Performance and Usage
@mvstore_1044_p
# Performance of in-memory operations is comparable with <code>java.util.TreeMap</code> (many operations are actually faster), but usually slower than <code>java.util.HashMap</code>.
@mvstore_1045_p
# If no file name is specified, the store operates purely in memory. Except for persisting data, all features are supported in this mode (multi-versioning, index lookup, R-tree and so on).
@mvstore_1046_p
# The memory overhead for large maps is slightly better than for the regular map implementations, but there is a higher overhead per map. For maps with less than 25 entries, the regular map implementations use less memory on average.
@mvstore_1047_h3
#Pluggable Data Types
@mvstore_1048_p
# Serialization is pluggable. The default serialization currently supports many common data types, and uses Java serialization for other objects. The following classes are currently directly supported: <code>Boolean, Byte, Short, Character, Integer, Long, Float, Double, BigInteger, BigDecimal, byte[], char[], int[], long[], String, UUID</code>. The plan is to add more common classes (date, time, timestamp, object array).
@mvstore_1049_p
# Parameterized data types are supported (for example one could build a string data type that limits the length for some reason).
@mvstore_1050_p
# The storage engine itself does not have any length limits, so that keys, values, pages, and chunks can be very big (as big as fits in memory). Also, there is no inherent limit to the number of maps and chunks. Due to using a log structured storage, there is no special case handling for large keys or pages.
@mvstore_1051_h3
#BLOB Support
@mvstore_1052_p
# There is a mechanism that stores large binary objects by splitting them into smaller blocks. This allows to store objects that don't fit in memory. Streaming as well as random access reads on such objects are supported. This tool is written on top of the store (only using the map interface).
@mvstore_1053_h3
#R-Tree and Pluggable Map Implementations
@mvstore_1054_p
# The map implementation is pluggable. In addition to the default MVMap (multi-version map), there is a multi-version R-tree map implementation for spatial operations (contain and intersection; nearest neighbor is not yet implemented).
@mvstore_1055_h3
#Concurrent Operations and Caching
@mvstore_1056_p
# At the moment, concurrent read on old versions of the data is supported. All such read operations can occur in parallel. Concurrent reads from the page cache, as well as concurrent reads from the file system are supported.
@mvstore_1057_p
# Caching is done on the page level. The page cache is a concurrent LIRS cache, which should be resistant against scan operations.
@mvstore_1058_p
# Concurrent modification operations on the maps are currently not supported, however it is planned to support an additional map implementation that supports concurrent writes (at the cost of speed if used in a single thread, same as <code>ConcurrentHashMap</code>).
@mvstore_1059_h3
#File System Abstraction, File Locking and Online Backup
@mvstore_1060_p
# The file system is pluggable (the same file system abstraction is used as H2 uses). Support for encryption is planned using an encrypting file system. Other file system implementations support reading from a compressed zip or tar file.
@mvstore_1061_p
# Each store may only be opened once within a JVM. When opening a store, the file is locked in exclusive mode, so that the file can only be changed from within one process. Files can be opened in read-only mode, in which case a shared lock is used.
@mvstore_1062_p
# The persisted data can be backed up to a different file at any time, even during write operations (online backup). To do that, automatic disk space reuse needs to be first disabled, so that new data is always appended at the end of the file. Then, the file can be copied (the file handle is available to the application).
@mvstore_1063_h3
#Tools
@mvstore_1064_p
# There is a builder for store instances (<code>MVStoreBuilder</code>) with a fluent API to simplify building a store instance.
@mvstore_1065_p
# There is a tool (<code>MVStoreTool</code>) to dump the contents of a file.
@mvstore_1066_h2
#Similar Projects and Differences to Other Storage Engines
@mvstore_1067_p
# Unlike similar storage engines like LevelDB and Kyoto Cabinet, the MVStore is written in Java and can easily be embedded in a Java application.
@mvstore_1068_p
# The MVStore is somewhat similar to the Berkeley DB Java Edition because it is also written in Java, and is also a log structured storage, but the H2 license is more liberal.
@mvstore_1069_p
# Like SQLite, the MVStore keeps all data in one file. The plan is to make the MVStore easier to use and faster than SQLite on Android (this was not recently tested, however an initial test was successful).
@mvstore_1070_p
# The API of the MVStore is similar to MapDB (previously known as JDBM) from Jan Kotek, and some code is shared between MapDB and JDBM. However, unlike MapDB, the MVStore uses is a log structured storage.
@mvstore_1071_h2
#Current State
@mvstore_1072_p
# The code is still very experimental at this stage. The API as well as the behavior will probably change. Features may be added and removed (even thought the main features will stay).
@mvstore_1073_h2
#Building the MVStore Library
@mvstore_1074_p
# There is currently no build script. To test it, run the test within the H2 project in Eclipse or any other IDE.
@mvstore_1075_h2
必要条件
@mvstore_1076_p
# There are no special requirements. The MVStore should run on any JVM as well as on Android (even thought this was not tested recently).
@performance_1000_h1 @performance_1000_h1
パフォーマンス パフォーマンス
......
...@@ -543,159 +543,172 @@ build_1111_li=The rail images (one straight, four junctions, two turns) are gene ...@@ -543,159 +543,172 @@ build_1111_li=The rail images (one straight, four junctions, two turns) are gene
build_1112_p=\ To generate railroad diagrams for other grammars, see the package <code>org.h2.jcr</code>. This package is used to generate the SQL-2 railroad diagrams for the JCR 2.0 specification. build_1112_p=\ To generate railroad diagrams for other grammars, see the package <code>org.h2.jcr</code>. This package is used to generate the SQL-2 railroad diagrams for the JCR 2.0 specification.
changelog_1000_h1=Change Log changelog_1000_h1=Change Log
changelog_1001_h2=Next Version (unreleased) changelog_1001_h2=Next Version (unreleased)
changelog_1002_li=PostgreSQL compatibility\: support for EXTRACT(WEEK FROM dateColumn). Thanks to Prashant Bhat for the patch\! changelog_1002_li=Issue 407\: The TriggerAdapter didn't work with CLOB and BLOB columns.
changelog_1003_li=Fix for a bug where we would sometimes use the wrong unique constraint to validate foreign key constraints. changelog_1003_li=PostgreSQL compatibility\: support for data types BIGSERIAL and SERIAL as an alias for AUTO_INCREMENT.
changelog_1004_h2=Version 1.3.169 (2012-09-09) changelog_1004_li=Issue 417\: H2 Console\: the web session timeout didn't work, resulting in a memory leak. This was only a problem if the H2 Console was run for a long time and many sessions were opened.
changelog_1005_li=The default jar file is now compiled for Java 6. changelog_1005_li=Issue 412\: Running the Server tool with just the option "-browser" will now log a warning.
changelog_1006_li=The new jar file will probably not end up in the central Maven repository in the next few weeks because Sonatype has disabled automatic synchronization from SourceForge (which they call 'legacy sync' now). It will probably take some time until this is sorted out. The H2 jar files are deployed to http\://h2database.com/m2-repo/com/h2database/h2/maven-metadata.xml and http\://hsql.sourceforge.net/m2-repo/com/h2database/h2/maven-metadata.xml as usual. changelog_1006_li=Issue 411\: CloseWatcher registration was not concurrency-safe.
changelog_1007_li=A part of the documentation and the H2 Console has been changed to support the Apple retina display. changelog_1007_li=MySQL compatibility\: support for CONCAT_WS. Thanks a lot to litailang for the patch\!
changelog_1008_li=The CreateCluster tool could not be used if the source database contained a CLOB or BLOB. The root cause was that the TCP server did not synchronize on the session, which caused a problem when using the exclusive mode. changelog_1008_li=PostgreSQL compatibility\: support for EXTRACT(WEEK FROM dateColumn). Thanks to Prashant Bhat for the patch\!
changelog_1009_li=Statement.getQueryTimeout()\: only the first call to this method will query the database. If the query timeout was changed in another way than calling setQueryTimeout, this method will always return the last value. This was changed because Hibernate calls getQueryTimeout() a lot. changelog_1009_li=Fix for a bug where we would sometimes use the wrong unique constraint to validate foreign key constraints.
changelog_1010_li=Issue 416\: PreparedStatement.setNString throws AbstractMethodError. All implemented JDBC 4 methods that don't break compatibility with Java 5 are now included in the default jar file. changelog_1010_li=Support BOM at the beginning of files for the RUNSCRIPT command
changelog_1011_li=Issue 414\: for some functions, the parameters were evaluated twice (for example "char(nextval(..))" ran "nextval(..)" twice). changelog_1011_li=Fix in calling SET @X \= IDENTITY() where it would return NULL incorrectly
changelog_1012_li=The ResultSetMetaData methods getSchemaName and getTableName could return null instead of "" (an empty string) as specified in the JDBC API. changelog_1012_li=Fix ABBA deadlock between adding a constraint and the H2-Log-Writer thread.
changelog_1013_li=Added compatibility for "SET NAMES" query in MySQL compatibility mode. changelog_1013_li=Optimize IN(...) queries where the values are constant and of the same type.
changelog_1014_h2=Version 1.3.168 (2012-07-13) changelog_1014_li=Restore tool\: the parameter "quiet" was not used and is now removed.
changelog_1015_li=The message "Transaction log could not be truncated" was sometimes written to the .trace.db file even if there was no problem truncating the transaction log. changelog_1015_li=Fix ConcurrentModificationException when creating tables and executing SHOW TABLES in parallel. Reported by Viktor Voytovych.
changelog_1016_li=New system property "h2.serializeJavaObject" (default\: true) that allows to disable serializing Java objects, so that the objects compareTo and toString methods can be used. changelog_1016_li=Serialization is now pluggable using the system property "h2.javaObjectSerializer". Thanks to Sergi Vladykin for the patch\!
changelog_1017_li=Dylan has translated the H2 Console tool to Korean. Thanks a lot\! changelog_1017_h2=Version 1.3.169 (2012-09-09)
changelog_1018_li=Executing the statement CREATE INDEX IF ALREADY EXISTS if the index already exists no longer fails for a read only database. changelog_1018_li=The default jar file is now compiled for Java 6.
changelog_1019_li=MVCC\: concurrently updating a row could result in the row to appear deleted in the second connection, if there are multiple unique indexes (or a primary key and at least one unique index). Thanks a lot to Teruo for the patch\! changelog_1019_li=The new jar file will probably not end up in the central Maven repository in the next few weeks because Sonatype has disabled automatic synchronization from SourceForge (which they call 'legacy sync' now). It will probably take some time until this is sorted out. The H2 jar files are deployed to http\://h2database.com/m2-repo/com/h2database/h2/maven-metadata.xml and http\://hsql.sourceforge.net/m2-repo/com/h2database/h2/maven-metadata.xml as usual.
changelog_1020_li=Fulltext search\: in-memory Lucene indexes are now supported. changelog_1020_li=A part of the documentation and the H2 Console has been changed to support the Apple retina display.
changelog_1021_li=Fulltext search\: UUID primary keys are now supported. changelog_1021_li=The CreateCluster tool could not be used if the source database contained a CLOB or BLOB. The root cause was that the TCP server did not synchronize on the session, which caused a problem when using the exclusive mode.
changelog_1022_li=Apache Tomcat 7.x will now longer log a warning when unloading the web application, if using a connection pool. changelog_1022_li=Statement.getQueryTimeout()\: only the first call to this method will query the database. If the query timeout was changed in another way than calling setQueryTimeout, this method will always return the last value. This was changed because Hibernate calls getQueryTimeout() a lot.
changelog_1023_li=H2 Console\: support the Midori browser (for Debian / Raspberry Pi) changelog_1023_li=Issue 416\: PreparedStatement.setNString throws AbstractMethodError. All implemented JDBC 4 methods that don't break compatibility with Java 5 are now included in the default jar file.
changelog_1024_li=When opening a remote session, don't open a temporary file if the trace level is set to zero changelog_1024_li=Issue 414\: for some functions, the parameters were evaluated twice (for example "char(nextval(..))" ran "nextval(..)" twice).
changelog_1025_li=Use HMAC for authenticating remote LOB id's, removing the need for maintaining a cache, and removing the limit on the number of LOBs per result set. changelog_1025_li=The ResultSetMetaData methods getSchemaName and getTableName could return null instead of "" (an empty string) as specified in the JDBC API.
changelog_1026_li=H2 Console\: HTML and XML documents can now be edited in an updatable result set. There is (limited) support for editing multi-line documents. changelog_1026_li=Added compatibility for "SET NAMES" query in MySQL compatibility mode.
changelog_1027_h2=Version 1.3.167 (2012-05-23) changelog_1027_h2=Version 1.3.168 (2012-07-13)
changelog_1028_li=H2 Console\: when editing a row, an empty varchar column was replaced with a single space. changelog_1028_li=The message "Transaction log could not be truncated" was sometimes written to the .trace.db file even if there was no problem truncating the transaction log.
changelog_1029_li=Lukas Eder has updated the jOOQ documentation. changelog_1029_li=New system property "h2.serializeJavaObject" (default\: true) that allows to disable serializing Java objects, so that the objects compareTo and toString methods can be used.
changelog_1030_li=Some nested joins could not be executed, for example\: select * from (select * from (select * from a) a right join b b) c; changelog_1030_li=Dylan has translated the H2 Console tool to Korean. Thanks a lot\!
changelog_1031_li=MS SQL Server compatibility\: ISNULL is now an alias for IFNULL. changelog_1031_li=Executing the statement CREATE INDEX IF ALREADY EXISTS if the index already exists no longer fails for a read only database.
changelog_1032_li=Terrence Huang has completed the translation of the H2 Console tool to Chinese. Thanks a lot\! changelog_1032_li=MVCC\: concurrently updating a row could result in the row to appear deleted in the second connection, if there are multiple unique indexes (or a primary key and at least one unique index). Thanks a lot to Teruo for the patch\!
changelog_1033_li=Server mode\: the number of CLOB / BLOB values that were cached on the server is now the maximum of\: 5 times the SERVER_RESULT_SET_FETCH_SIZE (which is 100 by default), and SysProperties.SERVER_CACHED_OBJECTS. changelog_1033_li=Fulltext search\: in-memory Lucene indexes are now supported.
changelog_1034_li=In the trace file, the query execution time was incorrect in some cases, specially for the statement SET TRACE_LEVEL_FILE 2. changelog_1034_li=Fulltext search\: UUID primary keys are now supported.
changelog_1035_li=The feature LOG_SIZE_LIMIT that was introduced in version 1.3.165 did not always work correctly (specially with regards to multithreading) and has been removed. The message "Transaction log could not be truncated" is still written to the .trace.db file if required. changelog_1035_li=Apache Tomcat 7.x will now longer log a warning when unloading the web application, if using a connection pool.
changelog_1036_li=Then reading from a resource using the prefix "classpath\:", the ContextClassLoader is now used if the resource can't be read otherwise. changelog_1036_li=H2 Console\: support the Midori browser (for Debian / Raspberry Pi)
changelog_1037_li=DatabaseEventListener now calls setProgress whenever a statement starts and ends. changelog_1037_li=When opening a remote session, don't open a temporary file if the trace level is set to zero
changelog_1038_li=DatabaseEventListener now calls setProgress periodically while a statement is running. changelog_1038_li=Use HMAC for authenticating remote LOB id's, removing the need for maintaining a cache, and removing the limit on the number of LOBs per result set.
changelog_1039_li=The table INFORMATION_SCHEMA.FUNCTION_ALIASES now includes a column TYPE_NAME. changelog_1039_li=H2 Console\: HTML and XML documents can now be edited in an updatable result set. There is (limited) support for editing multi-line documents.
changelog_1040_li=Issue 378\: when using views, the wrong values were bound to a parameter in some cases. changelog_1040_h2=Version 1.3.167 (2012-05-23)
changelog_1041_li=Terrence Huang has translated the error messages to Chinese. Thanks a lot\! changelog_1041_li=H2 Console\: when editing a row, an empty varchar column was replaced with a single space.
changelog_1042_li=TRUNC was added as an alias for TRUNCATE. changelog_1042_li=Lukas Eder has updated the jOOQ documentation.
changelog_1043_li=Small optimisation for accessing result values by column name. changelog_1043_li=Some nested joins could not be executed, for example\: select * from (select * from (select * from a) a right join b b) c;
changelog_1044_li=Fix for bug in Statement.getMoreResults(int) changelog_1044_li=MS SQL Server compatibility\: ISNULL is now an alias for IFNULL.
changelog_1045_li=The SCRIPT statements now supports filtering by schema and table. Thanks a lot to Jacob Qvortrup for providing the patch\! changelog_1045_li=Terrence Huang has completed the translation of the H2 Console tool to Chinese. Thanks a lot\!
changelog_1046_h2=Version 1.3.166 (2012-04-08) changelog_1046_li=Server mode\: the number of CLOB / BLOB values that were cached on the server is now the maximum of\: 5 times the SERVER_RESULT_SET_FETCH_SIZE (which is 100 by default), and SysProperties.SERVER_CACHED_OBJECTS.
changelog_1047_li=Indexes on column that are larger than half the page size (wide indexes) could sometimes get corrupt, resulting in an ArrayIndexOutOfBoundsException in PageBtree.getRow or "Row not found" in PageBtreeLeaf. Also, such indexes used too much disk space. changelog_1047_li=In the trace file, the query execution time was incorrect in some cases, specially for the statement SET TRACE_LEVEL_FILE 2.
changelog_1048_li=Server mode\: when retrieving more than 64 rows each containing a CLOB or BLOB, the error message "The object is already closed" was thrown. changelog_1048_li=The feature LOG_SIZE_LIMIT that was introduced in version 1.3.165 did not always work correctly (specially with regards to multithreading) and has been removed. The message "Transaction log could not be truncated" is still written to the .trace.db file if required.
changelog_1049_li=ConvertTraceFile\: the time in the trace file is now parsed as a long. changelog_1049_li=Then reading from a resource using the prefix "classpath\:", the ContextClassLoader is now used if the resource can't be read otherwise.
changelog_1050_li=Invalid connection settings are now detected. changelog_1050_li=DatabaseEventListener now calls setProgress whenever a statement starts and ends.
changelog_1051_li=Issue 387\: WHERE condition getting pushed into sub-query with LIMIT. changelog_1051_li=DatabaseEventListener now calls setProgress periodically while a statement is running.
changelog_1052_h2=Version 1.3.165 (2012-03-18) changelog_1052_li=The table INFORMATION_SCHEMA.FUNCTION_ALIASES now includes a column TYPE_NAME.
changelog_1053_li=Better string representation for decimal values (for example 0.00000000 instead of 0E-26). changelog_1053_li=Issue 378\: when using views, the wrong values were bound to a parameter in some cases.
changelog_1054_li=Prepared statements could only be re-used if the same data types were used the second time they were executed. changelog_1054_li=Terrence Huang has translated the error messages to Chinese. Thanks a lot\!
changelog_1055_li=In error messages about referential constraint violation, the values are now included. changelog_1055_li=TRUNC was added as an alias for TRUNCATE.
changelog_1056_li=SCRIPT and RUNSCRIPT\: the password can now be set using a prepared statement. Previously, it was required to be a literal in the SQL statement. changelog_1056_li=Small optimisation for accessing result values by column name.
changelog_1057_li=MySQL compatibility\: SUBSTR with a negative start index now works like MySQL. changelog_1057_li=Fix for bug in Statement.getMoreResults(int)
changelog_1058_li=When enabling autocommit, the transaction is now committed (as required by the JDBC API). changelog_1058_li=The SCRIPT statements now supports filtering by schema and table. Thanks a lot to Jacob Qvortrup for providing the patch\!
changelog_1059_li=The shell script <code>h2.sh</code> did not work with spaces in the path. It also works now with quoted spaces in the argument list. Thanks a lot to Shimizu Fumiyuki for the patch\! changelog_1059_h2=Version 1.3.166 (2012-04-08)
changelog_1060_li=If the transaction log could not be truncated because of an uncommitted transaction, now "Transaction log could not be truncated" is written to the .trace.db file. Before, the database file was growing and it was hard to find out what the root cause was. To avoid the database file from growing, a new feature to automatically rollback the oldest transaction is available now. To enable it, append ;LOG_SIZE_LIMIT\=32 to the database URL (in that case, the oldest session is rolled back if the transaction log is 32 MB). changelog_1060_li=Indexes on column that are larger than half the page size (wide indexes) could sometimes get corrupt, resulting in an ArrayIndexOutOfBoundsException in PageBtree.getRow or "Row not found" in PageBtreeLeaf. Also, such indexes used too much disk space.
changelog_1061_li=ALTER TABLE ADD can now add more than one column at a time. changelog_1061_li=Server mode\: when retrieving more than 64 rows each containing a CLOB or BLOB, the error message "The object is already closed" was thrown.
changelog_1062_li=Issue 380\: ALTER TABLE ADD FOREIGN KEY with an explicit index didn't verify the index can be used, which would lead to a NullPointerException later on. changelog_1062_li=ConvertTraceFile\: the time in the trace file is now parsed as a long.
changelog_1063_li=Issue 384\: the wrong kind of exception (NullPointerException) was thrown in a UNION query with an incorrect ORDER BY expression. changelog_1063_li=Invalid connection settings are now detected.
changelog_1064_li=Issue 362\: support LIMIT in UPDATE statements. changelog_1064_li=Issue 387\: WHERE condition getting pushed into sub-query with LIMIT.
changelog_1065_li=Browser\: if no default browser is set, Google Chrome is now used if available. If not available, then Konqueror, Netscape, or Opera is used if available (as before). changelog_1065_h2=Version 1.3.165 (2012-03-18)
changelog_1066_li=CSV tool\: new feature to disable writing the column header (option writeColumnHeader). changelog_1066_li=Better string representation for decimal values (for example 0.00000000 instead of 0E-26).
changelog_1067_li=CSV tool\: new feature to preserve the case sensitivity of column names (option caseSensitiveColumnNames). changelog_1067_li=Prepared statements could only be re-used if the same data types were used the second time they were executed.
changelog_1068_li=PostgreSQL compatibility\: LOG(x) is base 10 in the PostgreSQL mode. changelog_1068_li=In error messages about referential constraint violation, the values are now included.
changelog_1069_h2=Version 1.3.164 (2012-02-03) changelog_1069_li=SCRIPT and RUNSCRIPT\: the password can now be set using a prepared statement. Previously, it was required to be a literal in the SQL statement.
changelog_1070_li=New built-in function ARRAY_CONTAINS. changelog_1070_li=MySQL compatibility\: SUBSTR with a negative start index now works like MySQL.
changelog_1071_li=Some DatabaseMetaData methods didn't work when using ALLOW_LITERALS NONE. changelog_1071_li=When enabling autocommit, the transaction is now committed (as required by the JDBC API).
changelog_1072_li=Trying to convert a VARCHAR to UUID will now fail if the text contains a character that is not a hex digit, '-', or not a whitespace. changelog_1072_li=The shell script <code>h2.sh</code> did not work with spaces in the path. It also works now with quoted spaces in the argument list. Thanks a lot to Shimizu Fumiyuki for the patch\!
changelog_1073_li=TriggerAdapter\: in "before" triggers, values can be changed using the ResultSet.updateX methods. changelog_1073_li=If the transaction log could not be truncated because of an uncommitted transaction, now "Transaction log could not be truncated" is written to the .trace.db file. Before, the database file was growing and it was hard to find out what the root cause was. To avoid the database file from growing, a new feature to automatically rollback the oldest transaction is available now. To enable it, append ;LOG_SIZE_LIMIT\=32 to the database URL (in that case, the oldest session is rolled back if the transaction log is 32 MB).
changelog_1074_li=Creating a table with column data type NULL now works (even if not very useful). changelog_1074_li=ALTER TABLE ADD can now add more than one column at a time.
changelog_1075_li=ALTER TABLE ALTER COLUMN no longer copies the data for widening conversions (for example if only the precision was increased) unless necessary. changelog_1075_li=Issue 380\: ALTER TABLE ADD FOREIGN KEY with an explicit index didn't verify the index can be used, which would lead to a NullPointerException later on.
changelog_1076_li=Multi-threaded kernel\: concurrently running an online backup and updating the database resulted in a broken (transactionally incorrect) backup file in some cases. changelog_1076_li=Issue 384\: the wrong kind of exception (NullPointerException) was thrown in a UNION query with an incorrect ORDER BY expression.
changelog_1077_li=The script created by SCRIPT DROP did not always work if multiple views existed that depend on each other. changelog_1077_li=Issue 362\: support LIMIT in UPDATE statements.
changelog_1078_li=MathUtils.getSecureRandom could log a warning to System.err in case the /dev/random is very slow, and the System.getProperties().toString() returned a string larger than 64 KB. changelog_1078_li=Browser\: if no default browser is set, Google Chrome is now used if available. If not available, then Konqueror, Netscape, or Opera is used if available (as before).
changelog_1079_li=The database file locking mechanism "FS" (;FILE_LOCK\=FS) did not work on Linux since version 1.3.161. changelog_1079_li=CSV tool\: new feature to disable writing the column header (option writeColumnHeader).
changelog_1080_li=Sequences\: the functions NEXTVAL and CURRVAL did not work as expected when using quoted, mixed case sequence names. changelog_1080_li=CSV tool\: new feature to preserve the case sensitivity of column names (option caseSensitiveColumnNames).
changelog_1081_li=The constructor for Csv objects is now public, and Csv.getInstance() is now deprecated. changelog_1081_li=PostgreSQL compatibility\: LOG(x) is base 10 in the PostgreSQL mode.
changelog_1082_li=SimpleResultSet\: updating a result set is now supported. changelog_1082_h2=Version 1.3.164 (2012-02-03)
changelog_1083_li=Database URL\: extra semicolons are not supported. changelog_1083_li=New built-in function ARRAY_CONTAINS.
changelog_1084_h2=Version 1.3.163 (2011-12-30) changelog_1084_li=Some DatabaseMetaData methods didn't work when using ALLOW_LITERALS NONE.
changelog_1085_li=On out of disk space, the database could get corrupt sometimes, if later write operations succeeded. The same problem happened on other kinds of I/O exceptions (where one or some of the writes fail, but subsequent writes succeed). Now the file is closed on the first unsuccessful write operation, so that later requests fail consistently. changelog_1085_li=Trying to convert a VARCHAR to UUID will now fail if the text contains a character that is not a hex digit, '-', or not a whitespace.
changelog_1086_li=DatabaseEventListener.diskSpaceIsLow() is no longer supported because it can't be guaranteed that it always works correctly. changelog_1086_li=TriggerAdapter\: in "before" triggers, values can be changed using the ResultSet.updateX methods.
changelog_1087_li=XMLTEXT now supports an optional parameter to escape newlines. changelog_1087_li=Creating a table with column data type NULL now works (even if not very useful).
changelog_1088_li=XMLNODE now support an optional parameter to disable indentation. changelog_1088_li=ALTER TABLE ALTER COLUMN no longer copies the data for widening conversions (for example if only the precision was increased) unless necessary.
changelog_1089_li=Csv.write now formats date, time, and timestamp values using java.sql.Date / Time / Timestamp.toString(). Previously, ResultSet.getString() was used, which didn't work well for Oracle. changelog_1089_li=Multi-threaded kernel\: concurrently running an online backup and updating the database resulted in a broken (transactionally incorrect) backup file in some cases.
changelog_1090_li=The shell script <code>h2.sh</code> can now be run from within a different directory. Thanks a lot to Daniel Serodio for the patch\! changelog_1090_li=The script created by SCRIPT DROP did not always work if multiple views existed that depend on each other.
changelog_1091_li=The page size of a persistent database can now be queries using\: select * from information_schema.settings where name \= 'info.PAGE_SIZE' changelog_1091_li=MathUtils.getSecureRandom could log a warning to System.err in case the /dev/random is very slow, and the System.getProperties().toString() returned a string larger than 64 KB.
changelog_1092_li=In the server mode, BLOB and CLOB objects are no longer closed when the result set is closed (as required by the JDBC spec). changelog_1092_li=The database file locking mechanism "FS" (;FILE_LOCK\=FS) did not work on Linux since version 1.3.161.
changelog_1093_h2=Version 1.3.162 (2011-11-26) changelog_1093_li=Sequences\: the functions NEXTVAL and CURRVAL did not work as expected when using quoted, mixed case sequence names.
changelog_1094_li=The following system properties are no longer supported\: <code>h2.allowBigDecimalExtensions</code>, <code>h2.emptyPassword</code>, <code>h2.minColumnNameMap</code>, <code>h2.returnLobObjects</code>, <code>h2.webMaxValueLength</code>. changelog_1094_li=The constructor for Csv objects is now public, and Csv.getInstance() is now deprecated.
changelog_1095_li=When using a VPN, starting a H2 server did not work (for some VPN software). changelog_1095_li=SimpleResultSet\: updating a result set is now supported.
changelog_1096_li=Oracle compatibility\: support for DECODE(...). changelog_1096_li=Database URL\: extra semicolons are not supported.
changelog_1097_li=Lucene fulltext search\: creating an index is now faster if the table already contains data. Thanks a lot to Angel Leon from the FrostWire Team for the patch\! changelog_1097_h2=Version 1.3.163 (2011-12-30)
changelog_1098_li=Update statements with a column list in brackets did not work if the list only contains one column. Example\: update test set (id)\=(id). changelog_1098_li=On out of disk space, the database could get corrupt sometimes, if later write operations succeeded. The same problem happened on other kinds of I/O exceptions (where one or some of the writes fail, but subsequent writes succeed). Now the file is closed on the first unsuccessful write operation, so that later requests fail consistently.
changelog_1099_li=Read-only databases in a zip file did not work when using the -baseDir option. changelog_1099_li=DatabaseEventListener.diskSpaceIsLow() is no longer supported because it can't be guaranteed that it always works correctly.
changelog_1100_li=Issue 334\: SimpleResultSet.getString now also works for Clob columns. changelog_1100_li=XMLTEXT now supports an optional parameter to escape newlines.
changelog_1101_li=Subqueries with an aggregate did not always work. Example\: select (select count(*) from test where a \= t.a and b \= 0) from test t group by a changelog_1101_li=XMLNODE now support an optional parameter to disable indentation.
changelog_1102_li=Server\: in some (theoretical) cases, exceptions while closing the connection were ignored. changelog_1102_li=Csv.write now formats date, time, and timestamp values using java.sql.Date / Time / Timestamp.toString(). Previously, ResultSet.getString() was used, which didn't work well for Oracle.
changelog_1103_li=Server.createTcpServer, createPgServer, createWebServer\: invalid arguments are now detected. changelog_1103_li=The shell script <code>h2.sh</code> can now be run from within a different directory. Thanks a lot to Daniel Serodio for the patch\!
changelog_1104_li=The selectivity of LOB columns is no longer calculated because indexes on LOB columns are not supported (however this should have little effect on performance, as the selectivity is calculated from the hash code and not the data). changelog_1104_li=The page size of a persistent database can now be queries using\: select * from information_schema.settings where name \= 'info.PAGE_SIZE'
changelog_1105_li=New experimental system property "h2.modifyOnWrite"\: when enabled, the database file is only modified when writing to the database. When enabled, the serialized file lock is much faster for read-only operations. changelog_1105_li=In the server mode, BLOB and CLOB objects are no longer closed when the result set is closed (as required by the JDBC spec).
changelog_1106_li=A NullPointerException could occur in TableView.isDeterministic for invalid views. changelog_1106_h2=Version 1.3.162 (2011-11-26)
changelog_1107_li=Issue 180\: when deserializing objects, the context class loader is used instead of the default class loader if the system property "h2.useThreadContextClassLoader" is set. Thanks a lot to Noah Fontes for the patch\! changelog_1107_li=The following system properties are no longer supported\: <code>h2.allowBigDecimalExtensions</code>, <code>h2.emptyPassword</code>, <code>h2.minColumnNameMap</code>, <code>h2.returnLobObjects</code>, <code>h2.webMaxValueLength</code>.
changelog_1108_li=When using the exclusive mode, LOB operations could cause the thread to block. This also affected the CreateCluster tool (when using BLOB or CLOB data). changelog_1108_li=When using a VPN, starting a H2 server did not work (for some VPN software).
changelog_1109_li=The optimization for "group by" was not working correctly if the group by column was aliased in the select list. changelog_1109_li=Oracle compatibility\: support for DECODE(...).
changelog_1110_li=Issue 326\: improved support for case sensitive (mixed case) identifiers without quotes when using DATABASE_TO_UPPER\=FALSE. changelog_1110_li=Lucene fulltext search\: creating an index is now faster if the table already contains data. Thanks a lot to Angel Leon from the FrostWire Team for the patch\!
changelog_1111_h2=Version 1.3.161 (2011-10-28) changelog_1111_li=Update statements with a column list in brackets did not work if the list only contains one column. Example\: update test set (id)\=(id).
changelog_1112_li=Issue 351\: MySQL mode\: can not create a table with the column "KEY", and can not open databases where such a table already exists. changelog_1112_li=Read-only databases in a zip file did not work when using the -baseDir option.
changelog_1113_li=TCP server\: when using the trace option ("-trace"), the trace output contained unnecessary stack traces when stopping the server. changelog_1113_li=Issue 334\: SimpleResultSet.getString now also works for Clob columns.
changelog_1114_li=Issue 354\: when using the multi-threaded kernel option, and multiple threads concurrently prepared SQL statements that use the same view or the same index of a view, then in some cases an infinite loop could occur. changelog_1114_li=Subqueries with an aggregate did not always work. Example\: select (select count(*) from test where a \= t.a and b \= 0) from test t group by a
changelog_1115_li=Issue 350\: when using instead of triggers, executeUpdate for delete operations always returned 0. changelog_1115_li=Server\: in some (theoretical) cases, exceptions while closing the connection were ignored.
changelog_1116_li=Some timestamps with timezone were not converted correctly. For example, in the PST timezone, the timestamp 2011-10-26 08\:00\:00Z was converted to 2011-10-25 25\:00\:00 instead of 2011-10-26 01\:00\:00. Depending on the database operation, this caused subsequent error. changelog_1116_li=Server.createTcpServer, createPgServer, createWebServer\: invalid arguments are now detected.
changelog_1117_li=Sequences with cache size smaller than 0 did not work correctly. changelog_1117_li=The selectivity of LOB columns is no longer calculated because indexes on LOB columns are not supported (however this should have little effect on performance, as the selectivity is calculated from the hash code and not the data).
changelog_1118_li=Issue 356\: for Blob objects, InputStream.skip() returned 0, causing EOFException in Blob.getBytes(.., ..). changelog_1118_li=New experimental system property "h2.modifyOnWrite"\: when enabled, the database file is only modified when writing to the database. When enabled, the serialized file lock is much faster for read-only operations.
changelog_1119_li=Updatable result sets\: if the value is not set when inserting a new row, the default value is now used (the same behavior as MySQL, PostgreSQL, and Apache Derby) instead of NULL. changelog_1119_li=A NullPointerException could occur in TableView.isDeterministic for invalid views.
changelog_1120_li=Conditions of the form IN(SELECT ...) where slow and increased the database size if the subquery result size was larger then the configured MAX_MEMORY_ROWS. changelog_1120_li=Issue 180\: when deserializing objects, the context class loader is used instead of the default class loader if the system property "h2.useThreadContextClassLoader" is set. Thanks a lot to Noah Fontes for the patch\!
changelog_1121_li=Issue 347\: the RunScript and Shell tools now ignore empty statements. changelog_1121_li=When using the exclusive mode, LOB operations could cause the thread to block. This also affected the CreateCluster tool (when using BLOB or CLOB data).
changelog_1122_li=Issue 246\: improved error message for data conversion problems. changelog_1122_li=The optimization for "group by" was not working correctly if the group by column was aliased in the select list.
changelog_1123_li=Issue 344\: the build now supports a custom Maven repository location. changelog_1123_li=Issue 326\: improved support for case sensitive (mixed case) identifiers without quotes when using DATABASE_TO_UPPER\=FALSE.
changelog_1124_li=Issue 334\: Java functions that return CLOB or BLOB objects could not be used as tables. changelog_1124_h2=Version 1.3.161 (2011-10-28)
changelog_1125_li=SimpleResultSet now supports getColumnTypeName and getColumnClassName. changelog_1125_li=Issue 351\: MySQL mode\: can not create a table with the column "KEY", and can not open databases where such a table already exists.
changelog_1126_li=SimpleResultSet now has minimal BLOB and CLOB support. changelog_1126_li=TCP server\: when using the trace option ("-trace"), the trace output contained unnecessary stack traces when stopping the server.
changelog_1127_li=Improved performance for large databases (many GB), and databases with a small page size. changelog_1127_li=Issue 354\: when using the multi-threaded kernel option, and multiple threads concurrently prepared SQL statements that use the same view or the same index of a view, then in some cases an infinite loop could occur.
changelog_1128_li=The Polish translation has been improved by Jaros&\#322;aw Kokoci&\#324;ski. changelog_1128_li=Issue 350\: when using instead of triggers, executeUpdate for delete operations always returned 0.
changelog_1129_li=When using the built-in connection pool, after calling the "shutdown" SQL statement, a warning was written to the .trace.db file about an unclosed connection. changelog_1129_li=Some timestamps with timezone were not converted correctly. For example, in the PST timezone, the timestamp 2011-10-26 08\:00\:00Z was converted to 2011-10-25 25\:00\:00 instead of 2011-10-26 01\:00\:00. Depending on the database operation, this caused subsequent error.
changelog_1130_li=Improved compatibility for "fetch first / next row(s)". Thanks a lot to litailang for the patch\! changelog_1130_li=Sequences with cache size smaller than 0 did not work correctly.
changelog_1131_li=Improved compatibility with the Java 7 FileSystem abstraction. changelog_1131_li=Issue 356\: for Blob objects, InputStream.skip() returned 0, causing EOFException in Blob.getBytes(.., ..).
changelog_1132_h2=Version 1.3.160 (2011-09-11) changelog_1132_li=Updatable result sets\: if the value is not set when inserting a new row, the default value is now used (the same behavior as MySQL, PostgreSQL, and Apache Derby) instead of NULL.
changelog_1133_li=Computed columns could not refer to itself. changelog_1133_li=Conditions of the form IN(SELECT ...) where slow and increased the database size if the subquery result size was larger then the configured MAX_MEMORY_ROWS.
changelog_1134_li=Issue 340\: Comparison with "x \= all(select ...)" or similar in a view or subquery that was used as a table returned the wrong result. changelog_1134_li=Issue 347\: the RunScript and Shell tools now ignore empty statements.
changelog_1135_li=Comparison with "x \= all(select ...)" or similar returned the wrong result for some cases (for example if the subquery returned no rows, or multiple rows with the same value, or null, or if x was null). changelog_1135_li=Issue 246\: improved error message for data conversion problems.
changelog_1136_li=Issue 335\: Could not run DROP ALL OBJECTS DELETE FILES on older databases with CLOB or BLOB data. The problem was that the metadata table was not locked in some cases, so that a rollback could result in a corrupt database in a database if the lob storage was upgraded. changelog_1136_li=Issue 344\: the build now supports a custom Maven repository location.
changelog_1137_li=Source code switching using //\#\# has been simplified. The Java 1.5 tag has been removed because is no longer needed. changelog_1137_li=Issue 334\: Java functions that return CLOB or BLOB objects could not be used as tables.
changelog_1138_li=The JDBC methods PreparedStatement.setTimestamp, setTime, and setDate with a calendar, and the methods ResultSet.getTimestamp, getTime, and getDate with a calendar converted the value in the wrong way, so that for some timestamps the converted value was wrong (where summertime starts, one hour per year). changelog_1138_li=SimpleResultSet now supports getColumnTypeName and getColumnClassName.
changelog_1139_li=Invalid tables names in 'order by' columns were not detected in some cases. Example\: select x from dual order by y.x changelog_1139_li=SimpleResultSet now has minimal BLOB and CLOB support.
changelog_1140_li=Issue 329\: CASE expression\: data type problem is not detected. changelog_1140_li=Improved performance for large databases (many GB), and databases with a small page size.
changelog_1141_li=Issue 311\: File lock mode serialized\: selecting the next value from a sequence didn't work after a pause, because the database thought this is a read-only operation. changelog_1141_li=The Polish translation has been improved by Jaros&\#322;aw Kokoci&\#324;ski.
changelog_1142_h2=Version 1.3.159 (2011-08-13) changelog_1142_li=When using the built-in connection pool, after calling the "shutdown" SQL statement, a warning was written to the .trace.db file about an unclosed connection.
changelog_1143_li=Creating a temporary table with the option 'transactional' will now also create the indexes in transactional mode, if the indexes are included in the 'create table' statement as follows\: "create local temporary table temp(id int primary key, name varchar, constraint x index(name)) transactional". changelog_1143_li=Improved compatibility for "fetch first / next row(s)". Thanks a lot to litailang for the patch\!
changelog_1144_li=The database file size grows now 35%, but at most 256 MB at a time. changelog_1144_li=Improved compatibility with the Java 7 FileSystem abstraction.
changelog_1145_li=Improved error message on network configuration problems. changelog_1145_h2=Version 1.3.160 (2011-09-11)
changelog_1146_li=The build now support an offline build using ./build.sh offline. This will list the required dependencies if jar files are missing. changelog_1146_li=Computed columns could not refer to itself.
changelog_1147_li=The BLOB / CLOB data was dropped a little bit before the table was dropped. This could cause "lob not found" errors when the process was killed while a table was dropped. changelog_1147_li=Issue 340\: Comparison with "x \= all(select ...)" or similar in a view or subquery that was used as a table returned the wrong result.
changelog_1148_li="group_concat(distinct ...)" did not work correctly in a view or subquery (the 'distinct' was lost). Example\: select * from (select group_concat(distinct 1) from system_range(1, 3)); changelog_1148_li=Comparison with "x \= all(select ...)" or similar returned the wrong result for some cases (for example if the subquery returned no rows, or multiple rows with the same value, or null, or if x was null).
changelog_1149_li=Database URLs can now be re-mapped to another URL using the system property "h2.urlMap", which points to a properties file with database URL mappings. changelog_1149_li=Issue 335\: Could not run DROP ALL OBJECTS DELETE FILES on older databases with CLOB or BLOB data. The problem was that the metadata table was not locked in some cases, so that a rollback could result in a corrupt database in a database if the lob storage was upgraded.
changelog_1150_li=When using InputStream.skip, trying to read past the end of a BLOB failed with the exception "IO Exception\: Missing lob entry\: ..." [90028-...]. changelog_1150_li=Source code switching using //\#\# has been simplified. The Java 1.5 tag has been removed because is no longer needed.
changelog_1151_li=The in-memory file system "memFS\:" now has limited support for directories. changelog_1151_li=The JDBC methods PreparedStatement.setTimestamp, setTime, and setDate with a calendar, and the methods ResultSet.getTimestamp, getTime, and getDate with a calendar converted the value in the wrong way, so that for some timestamps the converted value was wrong (where summertime starts, one hour per year).
changelog_1152_li=To test recovery, append ;RECOVER_TEST\=64 to the database URL. This will simulate an application crash after each 64 writes to the database file. A log file named databaseName.h2.db.log is created that lists the operations. The recovery is tested using an in-memory file system, that means it may require a larger heap setting. changelog_1152_li=Invalid tables names in 'order by' columns were not detected in some cases. Example\: select x from dual order by y.x
changelog_1153_li=Converting a hex string to a byte array is now faster. changelog_1153_li=Issue 329\: CASE expression\: data type problem is not detected.
changelog_1154_li=The SQL statement "shutdown defrag" could corrupt the database if the process was killed while the shutdown was in progress. The same problem could occur when the database setting "defrag_always" was used. changelog_1154_li=Issue 311\: File lock mode serialized\: selecting the next value from a sequence didn't work after a pause, because the database thought this is a read-only operation.
changelog_1155_h2=Version 1.3.159 (2011-08-13)
changelog_1156_li=Creating a temporary table with the option 'transactional' will now also create the indexes in transactional mode, if the indexes are included in the 'create table' statement as follows\: "create local temporary table temp(id int primary key, name varchar, constraint x index(name)) transactional".
changelog_1157_li=The database file size grows now 35%, but at most 256 MB at a time.
changelog_1158_li=Improved error message on network configuration problems.
changelog_1159_li=The build now support an offline build using ./build.sh offline. This will list the required dependencies if jar files are missing.
changelog_1160_li=The BLOB / CLOB data was dropped a little bit before the table was dropped. This could cause "lob not found" errors when the process was killed while a table was dropped.
changelog_1161_li="group_concat(distinct ...)" did not work correctly in a view or subquery (the 'distinct' was lost). Example\: select * from (select group_concat(distinct 1) from system_range(1, 3));
changelog_1162_li=Database URLs can now be re-mapped to another URL using the system property "h2.urlMap", which points to a properties file with database URL mappings.
changelog_1163_li=When using InputStream.skip, trying to read past the end of a BLOB failed with the exception "IO Exception\: Missing lob entry\: ..." [90028-...].
changelog_1164_li=The in-memory file system "memFS\:" now has limited support for directories.
changelog_1165_li=To test recovery, append ;RECOVER_TEST\=64 to the database URL. This will simulate an application crash after each 64 writes to the database file. A log file named databaseName.h2.db.log is created that lists the operations. The recovery is tested using an in-memory file system, that means it may require a larger heap setting.
changelog_1166_li=Converting a hex string to a byte array is now faster.
changelog_1167_li=The SQL statement "shutdown defrag" could corrupt the database if the process was killed while the shutdown was in progress. The same problem could occur when the database setting "defrag_always" was used.
cheatSheet_1000_h1=H2 Database Engine Cheat Sheet cheatSheet_1000_h1=H2 Database Engine Cheat Sheet
cheatSheet_1001_h2=Using H2 cheatSheet_1001_h2=Using H2
cheatSheet_1002_a=H2 cheatSheet_1002_a=H2
...@@ -832,34 +845,35 @@ faq_1055_li=The optimizer may not always select the best plan. ...@@ -832,34 +845,35 @@ faq_1055_li=The optimizer may not always select the best plan.
faq_1056_li=Using the ICU4J collator. faq_1056_li=Using the ICU4J collator.
faq_1057_p=\ Areas considered experimental are\: faq_1057_p=\ Areas considered experimental are\:
faq_1058_li=The PostgreSQL server faq_1058_li=The PostgreSQL server
faq_1059_li=Multi-threading within the engine using <code>SET MULTI_THREADED\=1</code>. faq_1059_li=Clustering (there are cases were transaction isolation can be broken due to timing issues, for example one session overtaking another session).
faq_1060_li=Compatibility modes for other databases (only some features are implemented). faq_1060_li=Multi-threading within the engine using <code>SET MULTI_THREADED\=1</code>.
faq_1061_li=The soft reference cache (<code>CACHE_TYPE\=SOFT_LRU</code>). It might not improve performance, and out of memory issues have been reported. faq_1061_li=Compatibility modes for other databases (only some features are implemented).
faq_1062_p=\ Some users have reported that after a power failure, the database cannot be opened sometimes. In this case, use a backup of the database or the Recover tool. Please report such problems. The plan is that the database automatically recovers in all situations. faq_1062_li=The soft reference cache (<code>CACHE_TYPE\=SOFT_LRU</code>). It might not improve performance, and out of memory issues have been reported.
faq_1063_h3=Why is Opening my Database Slow? faq_1063_p=\ Some users have reported that after a power failure, the database cannot be opened sometimes. In this case, use a backup of the database or the Recover tool. Please report such problems. The plan is that the database automatically recovers in all situations.
faq_1064_p=\ To find out what the problem is, use the H2 Console and click on "Test Connection" instead of "Login". After the "Login Successful" appears, click on it (it's a link). This will list the top stack traces. Then either analyze this yourself, or post those stack traces in the Google Group. faq_1064_h3=Why is Opening my Database Slow?
faq_1065_p=\ Other possible reasons are\: the database is very big (many GB), or contains linked tables that are slow to open. faq_1065_p=\ To find out what the problem is, use the H2 Console and click on "Test Connection" instead of "Login". After the "Login Successful" appears, click on it (it's a link). This will list the top stack traces. Then either analyze this yourself, or post those stack traces in the Google Group.
faq_1066_h3=My Query is Slow faq_1066_p=\ Other possible reasons are\: the database is very big (many GB), or contains linked tables that are slow to open.
faq_1067_p=\ Slow <code>SELECT</code> (or <code>DELETE, UPDATE, MERGE</code>) statement can have multiple reasons. Follow this checklist\: faq_1067_h3=My Query is Slow
faq_1068_li=Run <code>ANALYZE</code> (see documentation for details). faq_1068_p=\ Slow <code>SELECT</code> (or <code>DELETE, UPDATE, MERGE</code>) statement can have multiple reasons. Follow this checklist\:
faq_1069_li=Run the query with <code>EXPLAIN</code> and check if indexes are used (see documentation for details). faq_1069_li=Run <code>ANALYZE</code> (see documentation for details).
faq_1070_li=If required, create additional indexes and try again using <code>ANALYZE</code> and <code>EXPLAIN</code>. faq_1070_li=Run the query with <code>EXPLAIN</code> and check if indexes are used (see documentation for details).
faq_1071_li=If it doesn't help please report the problem. faq_1071_li=If required, create additional indexes and try again using <code>ANALYZE</code> and <code>EXPLAIN</code>.
faq_1072_h3=H2 is Very Slow faq_1072_li=If it doesn't help please report the problem.
faq_1073_p=\ By default, H2 closes the database when the last connection is closed. If your application closes the only connection after each operation, the database is opened and closed a lot, which is quite slow. There are multiple ways to solve this problem, see <a href\="performance.html\#database_performance_tuning">Database Performance Tuning</a>. faq_1073_h3=H2 is Very Slow
faq_1074_h3=Column Names are Incorrect? faq_1074_p=\ By default, H2 closes the database when the last connection is closed. If your application closes the only connection after each operation, the database is opened and closed a lot, which is quite slow. There are multiple ways to solve this problem, see <a href\="performance.html\#database_performance_tuning">Database Performance Tuning</a>.
faq_1075_p=\ For the query <code>SELECT ID AS X FROM TEST</code> the method <code>ResultSetMetaData.getColumnName()</code> returns <code>ID</code>, I expect it to return <code>X</code>. What's wrong? faq_1075_h3=Column Names are Incorrect?
faq_1076_p=\ This is not a bug. According the the JDBC specification, the method <code>ResultSetMetaData.getColumnName()</code> should return the name of the column and not the alias name. If you need the alias name, use <a href\="http\://java.sun.com/javase/6/docs/api/java/sql/ResultSetMetaData.html\#getColumnLabel(int)"><code>ResultSetMetaData.getColumnLabel()</code></a>. Some other database don't work like this yet (they don't follow the JDBC specification). If you need compatibility with those databases, use the <a href\="features.html\#compatibility">Compatibility Mode</a>, or append <a href\="../javadoc/org/h2/constant/DbSettings.html\#ALIAS_COLUMN_NAME"><code>;ALIAS_COLUMN_NAME\=TRUE</code></a> to the database URL. faq_1076_p=\ For the query <code>SELECT ID AS X FROM TEST</code> the method <code>ResultSetMetaData.getColumnName()</code> returns <code>ID</code>, I expect it to return <code>X</code>. What's wrong?
faq_1077_p=\ This also applies to DatabaseMetaData calls that return a result set. The columns in the JDBC API are column labels, not column names. faq_1077_p=\ This is not a bug. According the the JDBC specification, the method <code>ResultSetMetaData.getColumnName()</code> should return the name of the column and not the alias name. If you need the alias name, use <a href\="http\://java.sun.com/javase/6/docs/api/java/sql/ResultSetMetaData.html\#getColumnLabel(int)"><code>ResultSetMetaData.getColumnLabel()</code></a>. Some other database don't work like this yet (they don't follow the JDBC specification). If you need compatibility with those databases, use the <a href\="features.html\#compatibility">Compatibility Mode</a>, or append <a href\="../javadoc/org/h2/constant/DbSettings.html\#ALIAS_COLUMN_NAME"><code>;ALIAS_COLUMN_NAME\=TRUE</code></a> to the database URL.
faq_1078_h3=Float is Double? faq_1078_p=\ This also applies to DatabaseMetaData calls that return a result set. The columns in the JDBC API are column labels, not column names.
faq_1079_p=\ For a table defined as <code>CREATE TABLE TEST(X FLOAT)</code> the method <code>ResultSet.getObject()</code> returns a <code>java.lang.Double</code>, I expect it to return a <code>java.lang.Float</code>. What's wrong? faq_1079_h3=Float is Double?
faq_1080_p=\ This is not a bug. According the the JDBC specification, the JDBC data type <code>FLOAT</code> is equivalent to <code>DOUBLE</code>, and both are mapped to <code>java.lang.Double</code>. See also <a href\="http\://java.sun.com/j2se/1.5.0/docs/guide/jdbc/getstart/mapping.html\#1055162"> Mapping SQL and Java Types - 8.3.10 FLOAT</a>. faq_1080_p=\ For a table defined as <code>CREATE TABLE TEST(X FLOAT)</code> the method <code>ResultSet.getObject()</code> returns a <code>java.lang.Double</code>, I expect it to return a <code>java.lang.Float</code>. What's wrong?
faq_1081_h3=Is the GCJ Version Stable? Faster? faq_1081_p=\ This is not a bug. According the the JDBC specification, the JDBC data type <code>FLOAT</code> is equivalent to <code>DOUBLE</code>, and both are mapped to <code>java.lang.Double</code>. See also <a href\="http\://java.sun.com/j2se/1.5.0/docs/guide/jdbc/getstart/mapping.html\#1055162"> Mapping SQL and Java Types - 8.3.10 FLOAT</a>.
faq_1082_p=\ The GCJ version is not as stable as the Java version. When running the regression test with the GCJ version, sometimes the application just stops at what seems to be a random point without error message. Currently, the GCJ version is also slower than when using the Sun VM. However, the startup of the GCJ version is faster than when using a VM. faq_1082_h3=Is the GCJ Version Stable? Faster?
faq_1083_h3=How to Translate this Project? faq_1083_p=\ The GCJ version is not as stable as the Java version. When running the regression test with the GCJ version, sometimes the application just stops at what seems to be a random point without error message. Currently, the GCJ version is also slower than when using the Sun VM. However, the startup of the GCJ version is faster than when using a VM.
faq_1084_p=\ For more information, see <a href\="build.html\#translating">Build/Translating</a>. faq_1084_h3=How to Translate this Project?
faq_1085_h3=How to Contribute to this Project? faq_1085_p=\ For more information, see <a href\="build.html\#translating">Build/Translating</a>.
faq_1086_p=\ There are various way to help develop an open source project like H2. The first step could be to <a href\="build.html\#translating">translate</a> the error messages and the GUI to your native language. Then, you could <a href\="build.html\#providing_patches">provide patches</a>. Please start with small patches. That could be adding a test case to improve the <a href\="build.html\#automated">code coverage</a> (the target code coverage for this project is 90%, higher is better). You will have to <a href\="build.html">develop, build and run the tests</a>. Once you are familiar with the code, you could implement missing features from the <a href\="roadmap.html">feature request list</a>. I suggest to start with very small features that are easy to implement. Keep in mind to provide test cases as well. faq_1086_h3=How to Contribute to this Project?
faq_1087_p=\ There are various way to help develop an open source project like H2. The first step could be to <a href\="build.html\#translating">translate</a> the error messages and the GUI to your native language. Then, you could <a href\="build.html\#providing_patches">provide patches</a>. Please start with small patches. That could be adding a test case to improve the <a href\="build.html\#automated">code coverage</a> (the target code coverage for this project is 90%, higher is better). You will have to <a href\="build.html">develop, build and run the tests</a>. Once you are familiar with the code, you could implement missing features from the <a href\="roadmap.html">feature request list</a>. I suggest to start with very small features that are easy to implement. Keep in mind to provide test cases as well.
features_1000_h1=Features features_1000_h1=Features
features_1001_a=\ Feature List features_1001_a=\ Feature List
features_1002_a=\ Comparison to Other Database Engines features_1002_a=\ Comparison to Other Database Engines
...@@ -1499,7 +1513,8 @@ fragments_1027_a=License ...@@ -1499,7 +1513,8 @@ fragments_1027_a=License
fragments_1028_a=Build fragments_1028_a=Build
fragments_1029_a=Links fragments_1029_a=Links
fragments_1030_a=JaQu fragments_1030_a=JaQu
fragments_1031_td=&nbsp; fragments_1031_a=MVStore
fragments_1032_td=&nbsp;
frame_1000_h1=H2 Database Engine frame_1000_h1=H2 Database Engine
frame_1001_p=\ Welcome to H2, the free SQL database. The main feature of H2 are\: frame_1001_p=\ Welcome to H2, the free SQL database. The main feature of H2 are\:
frame_1002_li=It is free to use for everybody, source code is included frame_1002_li=It is free to use for everybody, source code is included
...@@ -1545,47 +1560,49 @@ history_1030_a=SkyCash, Poland ...@@ -1545,47 +1560,49 @@ history_1030_a=SkyCash, Poland
history_1031_a=Lumber-mill, Inc., Japan history_1031_a=Lumber-mill, Inc., Japan
history_1032_a=StockMarketEye, USA history_1032_a=StockMarketEye, USA
history_1033_a=Eckenfelder GmbH & Co.KG, Germany history_1033_a=Eckenfelder GmbH & Co.KG, Germany
history_1034_li=Alessio Jacopo D'Adamo, Italy history_1034_li=Richard Hickey, USA
history_1035_li=Ashwin Jayaprakash, USA history_1035_li=Alessio Jacopo D'Adamo, Italy
history_1036_li=Donald Bleyl, USA history_1036_li=Ashwin Jayaprakash, USA
history_1037_li=Frank Berger, Germany history_1037_li=Donald Bleyl, USA
history_1038_li=Florent Ramiere, France history_1038_li=Frank Berger, Germany
history_1039_li=Jun Iyama, Japan history_1039_li=Florent Ramiere, France
history_1040_li=Antonio Casqueiro, Portugal history_1040_li=Jun Iyama, Japan
history_1041_li=Oliver Computing LLC, USA history_1041_li=Antonio Casqueiro, Portugal
history_1042_li=Harpal Grover Consulting Inc., USA history_1042_li=Oliver Computing LLC, USA
history_1043_li=Elisabetta Berlini, Italy history_1043_li=Harpal Grover Consulting Inc., USA
history_1044_li=William Gilbert, USA history_1044_li=Elisabetta Berlini, Italy
history_1045_li=Antonio Dieguez Rojas, Chile history_1045_li=William Gilbert, USA
history_1046_a=Ontology Works, USA history_1046_li=Antonio Dieguez Rojas, Chile
history_1047_li=Pete Haidinyak, USA history_1047_a=Ontology Works, USA
history_1048_li=William Osmond, USA history_1048_li=Pete Haidinyak, USA
history_1049_li=Joachim Ansorg, Germany history_1049_li=William Osmond, USA
history_1050_li=Oliver Soerensen, Germany history_1050_li=Joachim Ansorg, Germany
history_1051_li=Christos Vasilakis, Greece history_1051_li=Oliver Soerensen, Germany
history_1052_li=Fyodor Kupolov, Denmark history_1052_li=Christos Vasilakis, Greece
history_1053_li=Jakob Jenkov, Denmark history_1053_li=Fyodor Kupolov, Denmark
history_1054_li=St&eacute;phane Chartrand, Switzerland history_1054_li=Jakob Jenkov, Denmark
history_1055_li=Glenn Kidd, USA history_1055_li=St&eacute;phane Chartrand, Switzerland
history_1056_li=Gustav Trede, Sweden history_1056_li=Glenn Kidd, USA
history_1057_li=Joonas Pulakka, Finland history_1057_li=Gustav Trede, Sweden
history_1058_li=Bjorn Darri Sigurdsson, Iceland history_1058_li=Joonas Pulakka, Finland
history_1059_li=Iyama Jun, Japan history_1059_li=Bjorn Darri Sigurdsson, Iceland
history_1060_li=Gray Watson, USA history_1060_li=Iyama Jun, Japan
history_1061_li=Erik Dick, Germany history_1061_li=Gray Watson, USA
history_1062_li=Pengxiang Shao, China history_1062_li=Erik Dick, Germany
history_1063_li=Bilingual Marketing Group, USA history_1063_li=Pengxiang Shao, China
history_1064_li=Philippe Marschall, Switzerland history_1064_li=Bilingual Marketing Group, USA
history_1065_li=Knut Staring, Norway history_1065_li=Philippe Marschall, Switzerland
history_1066_li=Theis Borg, Denmark history_1066_li=Knut Staring, Norway
history_1067_li=Joel A. Garringer, USA history_1067_li=Theis Borg, Denmark
history_1068_li=Olivier Chafik, France history_1068_li=Joel A. Garringer, USA
history_1069_li=Rene Schwietzke, Germany history_1069_li=Olivier Chafik, France
history_1070_li=Jalpesh Patadia, USA history_1070_li=Rene Schwietzke, Germany
history_1071_li=Takanori Kawashima, Japan history_1071_li=Jalpesh Patadia, USA
history_1072_li=Terrence JC Huang, China history_1072_li=Takanori Kawashima, Japan
history_1073_a=JiaDong Huang, Australia history_1073_li=Terrence JC Huang, China
history_1074_li=Laurent van Roy, Belgium history_1074_a=JiaDong Huang, Australia
history_1075_li=Laurent van Roy, Belgium
history_1076_li=Qian Chen, China
installation_1000_h1=Installation installation_1000_h1=Installation
installation_1001_a=\ Requirements installation_1001_a=\ Requirements
installation_1002_a=\ Supported Platforms installation_1002_a=\ Supported Platforms
...@@ -2223,6 +2240,83 @@ main_1004_a=Tutorial ...@@ -2223,6 +2240,83 @@ main_1004_a=Tutorial
main_1005_p=\ Go through the samples. main_1005_p=\ Go through the samples.
main_1006_a=Features main_1006_a=Features
main_1007_p=\ See what this database can do and how to use these features. main_1007_p=\ See what this database can do and how to use these features.
mvstore_1000_h1=MVStore
mvstore_1001_a=\ Overview
mvstore_1002_a=\ Example Code
mvstore_1003_a=\ Features
mvstore_1004_a=\ Similar Projects and Differences to Other Storage Engines
mvstore_1005_a=\ Current State
mvstore_1006_a=\ Building the MVStore Library
mvstore_1007_a=\ Requirements
mvstore_1008_h2=Overview
mvstore_1009_p=\ The MVStore is work in progress, and is planned to be the next storage subsystem of H2.
mvstore_1010_li=MVStore stands for multi-version store.
mvstore_1011_li=Each store contains a number of maps (using the <code>java.util.Map</code> interface).
mvstore_1012_li=The data can be persisted to disk (like a key-value store or a database).
mvstore_1013_li=Fully in-memory operation is supported.
mvstore_1014_li=It is intended to be fast, simple to use, and small.
mvstore_1015_li=Old versions of the data can be read concurrently with all other operations.
mvstore_1016_li=Transaction are supported (currently only one transaction at a time).
mvstore_1017_li=Transactions (even if they are persisted) can be rolled back.
mvstore_1018_li=The tool is very modular. It supports pluggable data types / serialization, pluggable map implementations (B-tree and R-tree currently), BLOB storage, and a file system abstraction to support encryption and compressed read-only files.
mvstore_1019_h2=Example Code
mvstore_1020_h3=Map Operations and Versioning
mvstore_1021_p=\ The following sample code show how to create a store, open a map, add some data, and access the current and an old version.
mvstore_1022_h3=Store Builder
mvstore_1023_p=\ The <code>MVStoreBuilder</code> provides a fluid interface to build a store if more complex configuration options are used.
mvstore_1024_h3=R-Tree
mvstore_1025_p=\ The <code>MVRTreeMap</code> is an R-tree implementation that supports fast spatial queries.
mvstore_1026_h2=Features
mvstore_1027_h3=Maps
mvstore_1028_p=\ Each store supports a set of named maps. A map is sorted by key, and supports the common lookup operations, including access to the first and last key, iterate over some or all keys, and so on.
mvstore_1029_p=\ Also supported, and very uncommon for maps, is fast index lookup. The keys of the map can be accessed like a list (get the key at the given index, get the index of a certain key). That means getting the median of two keys is trivial, and it allows to very quickly count ranges. The iterator supports fast skipping. This is possible because internally, each map is organized in the form of a counted B+-tree.
mvstore_1030_p=\ In database terms, a map can be used like a table, where the key of the map is the primary key of the table, and the value is the row. A map can also represent an index, where the key of the map is the key of the index, and the value of the map is the primary key of the table (for non-unique indexes the key of the map must also contain the primary key).
mvstore_1031_h3=Versions / Transactions
mvstore_1032_p=\ Multiple versions are supported. A version is a snapshot of all the data of all maps at a given point in time. A transaction is a number of actions between two versions.
mvstore_1033_p=\ Versions / transactions are not immediately persisted; instead, only the version counter is incremented. If there is a change after switching to a new version, a snapshot of the old version is kept in memory, so that the old version can still be read.
mvstore_1034_p=\ Old persisted versions are readable until the old data was explicitly overwritten. Creating the snapshot is fast\: only the pages that are changed after a snapshot are copied. This behavior also called COW (copy on write).
mvstore_1035_p=\ Rollback is supported (rollback to any old in-memory version or an old persisted version).
mvstore_1036_h3=Log Structured Storage
mvstore_1037_p=\ Currently, store() needs to be called explicitly to save changes. Changes are buffered in memory, and once enough changes have accumulated (for example 2 MB), all changes are written in one continuous disk write operation. But of course, if needed, changes can also be persisted if only little data was changed. The estimated amount of unsaved changes is tracked. The plan is to automatically store in a background thread once there are enough changes.
mvstore_1038_p=\ When storing, all changed pages are serialized, compressed using the LZF algorithm (this can be disabled), and written sequentially to a free area of the file. Each such change set is called a chunk. All parent pages of the changed B-trees are stored in this chunk as well, so that each chunk also contains the root of each changed map (which is the entry point to read old data). There is no separate index\: all data is stored as a list of pages.
mvstore_1039_p=\ There are currently two write operations per chunk\: one to store the chunk data (the pages), and one to update the file header (so it points to the chunk head), but the plan is to write the file header only once in a while, so it does not slow down opening the store too much.
mvstore_1040_p=\ There is currently no transaction log, no undo log, and there are no in-place updates (however unused chunks are overwritten). To efficiently persist very small transactions, the plan is to support a transaction log where only the deltas is stored, until enough changes have accumulated to persist a chunk. Old versions are kept and are readable until they are no longer needed.
mvstore_1041_p=\ The plan is to keep all old data for at least one or two minutes (configurable), so that there are no explicit sync operations required to guarantee data consistency. To reuse disk space, the chunks with the lowest amount of live data are compacted (the live data is simply stored again in the next chunk). To improve data locality and disk space usage, the plan is to automatically defragment and compact data.
mvstore_1042_p=\ Compared to regular databases that use a transaction log, undo log, and main storage area, the log structured storage is simpler, more flexible, and typically needs less disk operations per change, as data is only written once instead of twice or 3 times, and because the B-tree pages are always full (they are stored next to each other) and can be easily compressed. But temporarily, disk space usage might actually be a bit higher than for a regular database, as disk space is not immediately re-used (there are no in-place updates).
mvstore_1043_h3=In-Memory Performance and Usage
mvstore_1044_p=\ Performance of in-memory operations is comparable with <code>java.util.TreeMap</code> (many operations are actually faster), but usually slower than <code>java.util.HashMap</code>.
mvstore_1045_p=\ If no file name is specified, the store operates purely in memory. Except for persisting data, all features are supported in this mode (multi-versioning, index lookup, R-tree and so on).
mvstore_1046_p=\ The memory overhead for large maps is slightly better than for the regular map implementations, but there is a higher overhead per map. For maps with less than 25 entries, the regular map implementations use less memory on average.
mvstore_1047_h3=Pluggable Data Types
mvstore_1048_p=\ Serialization is pluggable. The default serialization currently supports many common data types, and uses Java serialization for other objects. The following classes are currently directly supported\: <code>Boolean, Byte, Short, Character, Integer, Long, Float, Double, BigInteger, BigDecimal, byte[], char[], int[], long[], String, UUID</code>. The plan is to add more common classes (date, time, timestamp, object array).
mvstore_1049_p=\ Parameterized data types are supported (for example one could build a string data type that limits the length for some reason).
mvstore_1050_p=\ The storage engine itself does not have any length limits, so that keys, values, pages, and chunks can be very big (as big as fits in memory). Also, there is no inherent limit to the number of maps and chunks. Due to using a log structured storage, there is no special case handling for large keys or pages.
mvstore_1051_h3=BLOB Support
mvstore_1052_p=\ There is a mechanism that stores large binary objects by splitting them into smaller blocks. This allows to store objects that don't fit in memory. Streaming as well as random access reads on such objects are supported. This tool is written on top of the store (only using the map interface).
mvstore_1053_h3=R-Tree and Pluggable Map Implementations
mvstore_1054_p=\ The map implementation is pluggable. In addition to the default MVMap (multi-version map), there is a multi-version R-tree map implementation for spatial operations (contain and intersection; nearest neighbor is not yet implemented).
mvstore_1055_h3=Concurrent Operations and Caching
mvstore_1056_p=\ At the moment, concurrent read on old versions of the data is supported. All such read operations can occur in parallel. Concurrent reads from the page cache, as well as concurrent reads from the file system are supported.
mvstore_1057_p=\ Caching is done on the page level. The page cache is a concurrent LIRS cache, which should be resistant against scan operations.
mvstore_1058_p=\ Concurrent modification operations on the maps are currently not supported, however it is planned to support an additional map implementation that supports concurrent writes (at the cost of speed if used in a single thread, same as <code>ConcurrentHashMap</code>).
mvstore_1059_h3=File System Abstraction, File Locking and Online Backup
mvstore_1060_p=\ The file system is pluggable (the same file system abstraction is used as H2 uses). Support for encryption is planned using an encrypting file system. Other file system implementations support reading from a compressed zip or tar file.
mvstore_1061_p=\ Each store may only be opened once within a JVM. When opening a store, the file is locked in exclusive mode, so that the file can only be changed from within one process. Files can be opened in read-only mode, in which case a shared lock is used.
mvstore_1062_p=\ The persisted data can be backed up to a different file at any time, even during write operations (online backup). To do that, automatic disk space reuse needs to be first disabled, so that new data is always appended at the end of the file. Then, the file can be copied (the file handle is available to the application).
mvstore_1063_h3=Tools
mvstore_1064_p=\ There is a builder for store instances (<code>MVStoreBuilder</code>) with a fluent API to simplify building a store instance.
mvstore_1065_p=\ There is a tool (<code>MVStoreTool</code>) to dump the contents of a file.
mvstore_1066_h2=Similar Projects and Differences to Other Storage Engines
mvstore_1067_p=\ Unlike similar storage engines like LevelDB and Kyoto Cabinet, the MVStore is written in Java and can easily be embedded in a Java application.
mvstore_1068_p=\ The MVStore is somewhat similar to the Berkeley DB Java Edition because it is also written in Java, and is also a log structured storage, but the H2 license is more liberal.
mvstore_1069_p=\ Like SQLite, the MVStore keeps all data in one file. The plan is to make the MVStore easier to use and faster than SQLite on Android (this was not recently tested, however an initial test was successful).
mvstore_1070_p=\ The API of the MVStore is similar to MapDB (previously known as JDBM) from Jan Kotek, and some code is shared between MapDB and JDBM. However, unlike MapDB, the MVStore uses is a log structured storage.
mvstore_1071_h2=Current State
mvstore_1072_p=\ The code is still very experimental at this stage. The API as well as the behavior will probably change. Features may be added and removed (even thought the main features will stay).
mvstore_1073_h2=Building the MVStore Library
mvstore_1074_p=\ There is currently no build script. To test it, run the test within the H2 project in Eclipse or any other IDE.
mvstore_1075_h2=Requirements
mvstore_1076_p=\ There are no special requirements. The MVStore should run on any JVM as well as on Android (even thought this was not tested recently).
performance_1000_h1=Performance performance_1000_h1=Performance
performance_1001_a=\ Performance Comparison performance_1001_a=\ Performance Comparison
performance_1002_a=\ PolePosition Benchmark performance_1002_a=\ PolePosition Benchmark
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
package org.h2.api; package org.h2.api;
/** /**
* Custom serialization mechanism for java objects being stored in column of type OTHER. * Custom serialization mechanism for java objects being stored in column of
* type OTHER.
* *
* @author Sergi Vladykin * @author Sergi Vladykin
*/ */
...@@ -16,15 +17,15 @@ public interface JavaObjectSerializer { ...@@ -16,15 +17,15 @@ public interface JavaObjectSerializer {
/** /**
* Serialize object to byte array. * Serialize object to byte array.
* *
* @param obj * @param obj the object to serialize
* @return the byte array * @return the byte array of the serialized object
*/ */
byte[] serialize(Object obj) throws Exception; byte[] serialize(Object obj) throws Exception;
/** /**
* Deserialize object from byte array. * Deserialize object from byte array.
* *
* @param bytes * @param bytes the byte array of the serialized object
* @return the object * @return the object
*/ */
Object deserialize(byte[] bytes) throws Exception; Object deserialize(byte[] bytes) throws Exception;
......
...@@ -399,8 +399,9 @@ public class SysProperties { ...@@ -399,8 +399,9 @@ public class SysProperties {
/** /**
* System property <code>h2.javaObjectSerializer</code> (default: null).<br /> * System property <code>h2.javaObjectSerializer</code> (default: null).<br />
* The JavaObjectSerializer class name for java objects being stored in column of type OTHER. * The JavaObjectSerializer class name for java objects being stored in
* It must be the same on client and server to work correctly. * column of type OTHER. It must be the same on client and server to work
* correctly.
*/ */
public static final String JAVA_OBJECT_SERIALIZER = Utils.getProperty("h2.javaObjectSerializer", null); public static final String JAVA_OBJECT_SERIALIZER = Utils.getProperty("h2.javaObjectSerializer", null);
......
...@@ -19,10 +19,11 @@ import org.h2.value.ValueBoolean; ...@@ -19,10 +19,11 @@ import org.h2.value.ValueBoolean;
import org.h2.value.ValueNull; import org.h2.value.ValueNull;
/** /**
* Used for optimised IN(...) queries where the contents of the IN list are all constant and of the same type. * Used for optimised IN(...) queries where the contents of the IN list are all
* constant and of the same type.
* <p> * <p>
* Checking using a HashSet is has time complexity O(1), instead of O(n) for checking using * Checking using a HashSet is has time complexity O(1), instead of O(n) for
* an array. * checking using an array.
*/ */
public class ConditionInConstantSet extends Condition { public class ConditionInConstantSet extends Condition {
...@@ -34,6 +35,7 @@ public class ConditionInConstantSet extends Condition { ...@@ -34,6 +35,7 @@ public class ConditionInConstantSet extends Condition {
/** /**
* Create a new IN(..) condition. * Create a new IN(..) condition.
* *
* @param session the session
* @param left the expression before IN * @param left the expression before IN
* @param valueList the value list (at least two elements) * @param valueList the value list (at least two elements)
*/ */
......
...@@ -1016,7 +1016,7 @@ CONCAT(string, string [,...]) ...@@ -1016,7 +1016,7 @@ CONCAT(string, string [,...])
"," ","
Combines strings." Combines strings."
"Functions (String)","CONCAT_WS"," "Functions (String)","CONCAT_WS","
CONCAT_WS(string, string, string [,...]) CONCAT_WS(separatorString, string, string [,...])
"," ","
Combines strings with separator." Combines strings with separator."
"Functions (String)","DIFFERENCE"," "Functions (String)","DIFFERENCE","
......
...@@ -1710,8 +1710,8 @@ public class PageStore implements CacheWriter { ...@@ -1710,8 +1710,8 @@ public class PageStore implements CacheWriter {
Table table = index.getTable(); Table table = index.getTable();
if (SysProperties.CHECK) { if (SysProperties.CHECK) {
if (!table.isTemporary()) { if (!table.isTemporary()) {
/* To prevent ABBA locking problems, we need to always take the Database lock before we take the // to prevent ABBA locking problems, we need to always take
* PageStore lock. */ // the Database lock before we take the PageStore lock
synchronized (database) { synchronized (database) {
synchronized (this) { synchronized (this) {
database.verifyMetaLocked(session); database.verifyMetaLocked(session);
...@@ -1764,8 +1764,8 @@ public class PageStore implements CacheWriter { ...@@ -1764,8 +1764,8 @@ public class PageStore implements CacheWriter {
public void removeMeta(Index index, Session session) { public void removeMeta(Index index, Session session) {
if (SysProperties.CHECK) { if (SysProperties.CHECK) {
if (!index.getTable().isTemporary()) { if (!index.getTable().isTemporary()) {
/* To prevent ABBA locking problems, we need to always take the Database lock before we take the // to prevent ABBA locking problems, we need to always take
* PageStore lock. */ // the Database lock before we take the PageStore lock
synchronized (database) { synchronized (database) {
synchronized (this) { synchronized (this) {
database.verifyMetaLocked(session); database.verifyMetaLocked(session);
......
...@@ -216,7 +216,11 @@ class FilePathMemLZF extends FilePathMem { ...@@ -216,7 +216,11 @@ class FilePathMemLZF extends FilePathMem {
*/ */
class FileMem extends FileBase { class FileMem extends FileBase {
/**
* The file data.
*/
final FileMemData data; final FileMemData data;
private final boolean readOnly; private final boolean readOnly;
private long pos; private long pos;
...@@ -352,6 +356,11 @@ class FileMemData { ...@@ -352,6 +356,11 @@ class FileMemData {
lastModified = System.currentTimeMillis(); lastModified = System.currentTimeMillis();
} }
/**
* Lock the file in exclusive mode if possible.
*
* @return if locking was successful
*/
synchronized boolean lockExclusive() { synchronized boolean lockExclusive() {
if (sharedLockCount > 0 || isLockedExclusive) { if (sharedLockCount > 0 || isLockedExclusive) {
return false; return false;
...@@ -360,6 +369,11 @@ class FileMemData { ...@@ -360,6 +369,11 @@ class FileMemData {
return true; return true;
} }
/**
* Lock the file in shared mode if possible.
*
* @return if locking was successful
*/
synchronized boolean lockShared() { synchronized boolean lockShared() {
if (isLockedExclusive) { if (isLockedExclusive) {
return false; return false;
...@@ -368,6 +382,9 @@ class FileMemData { ...@@ -368,6 +382,9 @@ class FileMemData {
return true; return true;
} }
/**
* Unlock the file.
*/
synchronized void unlock() { synchronized void unlock() {
if (isLockedExclusive) { if (isLockedExclusive) {
isLockedExclusive = false; isLockedExclusive = false;
......
...@@ -47,7 +47,8 @@ public class TableView extends Table { ...@@ -47,7 +47,8 @@ public class TableView extends Table {
private ViewIndex index; private ViewIndex index;
private boolean recursive; private boolean recursive;
private DbException createException; private DbException createException;
private final SmallLRUCache<IntArray, ViewIndex> indexCache = SmallLRUCache.newInstance(Constants.VIEW_INDEX_CACHE_SIZE); private final SmallLRUCache<IntArray, ViewIndex> indexCache =
SmallLRUCache.newInstance(Constants.VIEW_INDEX_CACHE_SIZE);
private long lastModificationCheck; private long lastModificationCheck;
private long maxDataModificationId; private long maxDataModificationId;
private User owner; private User owner;
......
...@@ -31,6 +31,9 @@ import org.h2.message.DbException; ...@@ -31,6 +31,9 @@ import org.h2.message.DbException;
*/ */
public class Utils { public class Utils {
/**
* The serializer to use.
*/
public static JavaObjectSerializer serializer; public static JavaObjectSerializer serializer;
/** /**
......
...@@ -47,7 +47,7 @@ public class TestStreamStore extends TestBase { ...@@ -47,7 +47,7 @@ public class TestStreamStore extends TestBase {
testLoop(); testLoop();
} }
public void testDetectIllegalId() throws IOException { private void testDetectIllegalId() throws IOException {
Map<Long, byte[]> map = New.hashMap(); Map<Long, byte[]> map = New.hashMap();
StreamStore store = new StreamStore(map); StreamStore store = new StreamStore(map);
try { try {
...@@ -72,7 +72,7 @@ public class TestStreamStore extends TestBase { ...@@ -72,7 +72,7 @@ public class TestStreamStore extends TestBase {
} }
} }
public void testTreeStructure() throws IOException { private void testTreeStructure() throws IOException {
final AtomicInteger reads = new AtomicInteger(); final AtomicInteger reads = new AtomicInteger();
Map<Long, byte[]> map = new HashMap<Long, byte[]>() { Map<Long, byte[]> map = new HashMap<Long, byte[]>() {
...@@ -95,7 +95,7 @@ public class TestStreamStore extends TestBase { ...@@ -95,7 +95,7 @@ public class TestStreamStore extends TestBase {
assertEquals(3, reads.get()); assertEquals(3, reads.get());
} }
public void testFormat() throws IOException { private void testFormat() throws IOException {
Map<Long, byte[]> map = New.hashMap(); Map<Long, byte[]> map = New.hashMap();
StreamStore store = new StreamStore(map); StreamStore store = new StreamStore(map);
store.setMinBlockSize(10); store.setMinBlockSize(10);
...@@ -128,7 +128,7 @@ public class TestStreamStore extends TestBase { ...@@ -128,7 +128,7 @@ public class TestStreamStore extends TestBase {
assertEquals(1, in.skip(1)); assertEquals(1, in.skip(1));
} }
public void testWithExistingData() throws IOException { private void testWithExistingData() throws IOException {
final AtomicInteger tests = new AtomicInteger(); final AtomicInteger tests = new AtomicInteger();
Map<Long, byte[]> map = new HashMap<Long, byte[]>() { Map<Long, byte[]> map = new HashMap<Long, byte[]>() {
...@@ -170,7 +170,7 @@ public class TestStreamStore extends TestBase { ...@@ -170,7 +170,7 @@ public class TestStreamStore extends TestBase {
} }
} }
public void testWithFullMap() throws IOException { private void testWithFullMap() throws IOException {
final AtomicInteger tests = new AtomicInteger(); final AtomicInteger tests = new AtomicInteger();
Map<Long, byte[]> map = new HashMap<Long, byte[]>() { Map<Long, byte[]> map = new HashMap<Long, byte[]>() {
...@@ -196,7 +196,7 @@ public class TestStreamStore extends TestBase { ...@@ -196,7 +196,7 @@ public class TestStreamStore extends TestBase {
assertEquals(Long.MAX_VALUE / 2 + 1, store.getNextKey()); assertEquals(Long.MAX_VALUE / 2 + 1, store.getNextKey());
} }
public void testLoop() throws IOException { private void testLoop() throws IOException {
Map<Long, byte[]> map = New.hashMap(); Map<Long, byte[]> map = New.hashMap();
StreamStore store = new StreamStore(map); StreamStore store = new StreamStore(map);
assertEquals(256 * 1024, store.getMaxBlockSize()); assertEquals(256 * 1024, store.getMaxBlockSize());
......
...@@ -33,8 +33,16 @@ public class SpellChecker { ...@@ -33,8 +33,16 @@ public class SpellChecker {
private static final String PREFIX_IGNORE = "abc"; private static final String PREFIX_IGNORE = "abc";
private static final String[] IGNORE_FILES = {"mainWeb.html", "pg_catalog.sql"}; private static final String[] IGNORE_FILES = {"mainWeb.html", "pg_catalog.sql"};
// these are public so we can set them during development testing // These are public so we can set them during development testing
/**
* Whether debugging is enabled.
*/
public boolean debug; public boolean debug;
/**
* Whether to print the dictionary.
*/
public boolean printDictionary; public boolean printDictionary;
private final HashSet<String> dictionary = new HashSet<String>(); private final HashSet<String> dictionary = new HashSet<String>();
......
...@@ -719,5 +719,4 @@ richard viktor structured continuous inherent kyoto contends abba optimised ...@@ -719,5 +719,4 @@ richard viktor structured continuous inherent kyoto contends abba optimised
rollbacks overtaking trivial mutation pitest rectangle uncommon deltas rollbacks overtaking trivial mutation pitest rectangle uncommon deltas
purely intersection obviously cabinet berkeley configurable modular locality purely intersection obviously cabinet berkeley configurable modular locality
subsystem persisting pit jdbm bigserial rtree mutationtest serializer feff mvstore subsystem persisting pit jdbm bigserial rtree mutationtest serializer feff mvstore
versioning versioning sector survives
\ No newline at end of file
...@@ -71,11 +71,18 @@ public class Chunk { ...@@ -71,11 +71,18 @@ public class Chunk {
*/ */
long version; long version;
public Chunk(int id) { Chunk(int id) {
this.id = id; this.id = id;
} }
public static Chunk fromHeader(ByteBuffer buff, long start) { /**
* Read the header from the byte buffer.
*
* @param buff the source buffer
* @param start the start of the chunk in the file
* @return the chunk
*/
static Chunk fromHeader(ByteBuffer buff, long start) {
if (buff.get() != 'c') { if (buff.get() != 'c') {
throw new RuntimeException("File corrupt"); throw new RuntimeException("File corrupt");
} }
...@@ -95,6 +102,11 @@ public class Chunk { ...@@ -95,6 +102,11 @@ public class Chunk {
return c; return c;
} }
/**
* Write the header.
*
* @param buff the target buffer
*/
void writeHeader(ByteBuffer buff) { void writeHeader(ByteBuffer buff) {
buff.put((byte) 'c'); buff.put((byte) 'c');
buff.putInt(length); buff.putInt(length);
...@@ -137,6 +149,11 @@ public class Chunk { ...@@ -137,6 +149,11 @@ public class Chunk {
return o instanceof Chunk && ((Chunk) o).id == id; return o instanceof Chunk && ((Chunk) o).id == id;
} }
/**
* Get the chunk data as a string.
*
* @return the string
*/
public String asString() { public String asString() {
return return
"id:" + id + "," + "id:" + id + "," +
......
...@@ -44,6 +44,12 @@ public class Cursor<K> implements Iterator<K> { ...@@ -44,6 +44,12 @@ public class Cursor<K> implements Iterator<K> {
return current != null; return current != null;
} }
/**
* Skip over that many entries. This method is relatively fast (for this map
* implementation) even if many entries need to be skipped.
*
* @param n the number of entries to skip
*/
public void skip(long n) { public void skip(long n) {
if (!hasNext()) { if (!hasNext()) {
return; return;
...@@ -64,6 +70,13 @@ public class Cursor<K> implements Iterator<K> { ...@@ -64,6 +70,13 @@ public class Cursor<K> implements Iterator<K> {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
/**
* Fetch the next entry that is equal or larger than the given key, starting
* from the given page.
*
* @param p the page to start
* @param from the key to search
*/
protected void min(Page p, K from) { protected void min(Page p, K from) {
while (true) { while (true) {
if (p.isLeaf()) { if (p.isLeaf()) {
...@@ -85,6 +98,9 @@ public class Cursor<K> implements Iterator<K> { ...@@ -85,6 +98,9 @@ public class Cursor<K> implements Iterator<K> {
} }
} }
/**
* Fetch the next entry if there is one.
*/
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
protected void fetchNext() { protected void fetchNext() {
while (pos != null) { while (pos != null) {
......
...@@ -301,6 +301,7 @@ public class DataUtils { ...@@ -301,6 +301,7 @@ public class DataUtils {
* has been reached. The buffer is rewind at the end. * has been reached. The buffer is rewind at the end.
* *
* @param file the file channel * @param file the file channel
* @param pos the absolute position within the file
* @param dst the byte buffer * @param dst the byte buffer
*/ */
public static void readFully(FileChannel file, long pos, ByteBuffer dst) throws IOException { public static void readFully(FileChannel file, long pos, ByteBuffer dst) throws IOException {
...@@ -318,6 +319,7 @@ public class DataUtils { ...@@ -318,6 +319,7 @@ public class DataUtils {
* Write to a file channel. * Write to a file channel.
* *
* @param file the file channel * @param file the file channel
* @param pos the absolute position within the file
* @param src the source buffer * @param src the source buffer
*/ */
public static void writeFully(FileChannel file, long pos, ByteBuffer src) throws IOException { public static void writeFully(FileChannel file, long pos, ByteBuffer src) throws IOException {
......
...@@ -54,6 +54,12 @@ public class MVMap<K, V> extends AbstractMap<K, V> ...@@ -54,6 +54,12 @@ public class MVMap<K, V> extends AbstractMap<K, V>
this.root = Page.createEmpty(this, -1); this.root = Page.createEmpty(this, -1);
} }
/**
* Open this map with the given store and configuration.
*
* @param store the store
* @param config the configuration
*/
public void open(MVStore store, HashMap<String, String> config) { public void open(MVStore store, HashMap<String, String> config) {
this.store = store; this.store = store;
this.id = Integer.parseInt(config.get("id")); this.id = Integer.parseInt(config.get("id"));
...@@ -450,7 +456,7 @@ public class MVMap<K, V> extends AbstractMap<K, V> ...@@ -450,7 +456,7 @@ public class MVMap<K, V> extends AbstractMap<K, V>
* Remove all entries, and close the map. * Remove all entries, and close the map.
*/ */
public void removeMap() { public void removeMap() {
if (!store.isMetaMap(this)) { if (this != store.getMetaMap()) {
checkWrite(); checkWrite();
root.removeAllRecursive(); root.removeAllRecursive();
store.removeMap(name); store.removeMap(name);
...@@ -492,6 +498,7 @@ public class MVMap<K, V> extends AbstractMap<K, V> ...@@ -492,6 +498,7 @@ public class MVMap<K, V> extends AbstractMap<K, V>
* Add a key-value pair if it does not yet exist. * Add a key-value pair if it does not yet exist.
* *
* @param key the key (may not be null) * @param key the key (may not be null)
* @param value the new value
* @return the old value if the key existed, or null otherwise * @return the old value if the key existed, or null otherwise
*/ */
public synchronized V putIfAbsent(K key, V value) { public synchronized V putIfAbsent(K key, V value) {
...@@ -599,6 +606,11 @@ public class MVMap<K, V> extends AbstractMap<K, V> ...@@ -599,6 +606,11 @@ public class MVMap<K, V> extends AbstractMap<K, V>
return result; return result;
} }
/**
* Use the new root page from now on.
*
* @param newRoot the new root page
*/
protected void newRoot(Page newRoot) { protected void newRoot(Page newRoot) {
if (root != newRoot) { if (root != newRoot) {
removeUnusedOldVersions(); removeUnusedOldVersions();
...@@ -907,6 +919,11 @@ public class MVMap<K, V> extends AbstractMap<K, V> ...@@ -907,6 +919,11 @@ public class MVMap<K, V> extends AbstractMap<K, V>
return m; return m;
} }
/**
* Open a copy of the map in read-only mode.
*
* @return the opened map
*/
protected MVMap<K, V> openReadOnly() { protected MVMap<K, V> openReadOnly() {
MVMap<K, V> m = new MVMap<K, V>(keyType, valueType); MVMap<K, V> m = new MVMap<K, V>(keyType, valueType);
m.readOnly = true; m.readOnly = true;
...@@ -939,6 +956,14 @@ public class MVMap<K, V> extends AbstractMap<K, V> ...@@ -939,6 +956,14 @@ public class MVMap<K, V> extends AbstractMap<K, V>
return root.getVersion(); return root.getVersion();
} }
/**
* Get the child page count for this page. This is to allow another map
* implementation to override the default, in case the last child is not to
* be used.
*
* @param p the page
* @return the number of direct children
*/
protected int getChildPageCount(Page p) { protected int getChildPageCount(Page p) {
return p.getChildPageCount(); return p.getChildPageCount();
} }
...@@ -952,6 +977,11 @@ public class MVMap<K, V> extends AbstractMap<K, V> ...@@ -952,6 +977,11 @@ public class MVMap<K, V> extends AbstractMap<K, V>
return "btree"; return "btree";
} }
/**
* Get the map metadata as a string.
*
* @return the string
*/
public String asString() { public String asString() {
StringBuilder buff = new StringBuilder(); StringBuilder buff = new StringBuilder();
DataUtils.appendMap(buff, "id", id); DataUtils.appendMap(buff, "id", id);
......
...@@ -43,12 +43,14 @@ TODO: ...@@ -43,12 +43,14 @@ TODO:
- support serialization by default - support serialization by default
- build script - build script
- test concurrent storing in a background thread - test concurrent storing in a background thread
- store store creation in file header, and seconds since creation in chunk header (plus a counter) - store store creation in file header, and seconds since creation
- recovery: keep some old chunks; don't overwritten for 5 minutes (configurable) -- in chunk header (plus a counter)
- recovery: keep some old chunks; don't overwritten
-- for 5 minutes (configurable)
- allocate memory with Utils.newBytes and so on - allocate memory with Utils.newBytes and so on
- unified exception handling - unified exception handling
- concurrent map; avoid locking during IO (pre-load pages) - concurrent map; avoid locking during IO (pre-load pages)
- maybe split database into multiple files, to speed up compact operation - maybe split database into multiple files, to speed up compact
- automated 'kill process' and 'power failure' test - automated 'kill process' and 'power failure' test
- implement table engine for H2 - implement table engine for H2
- auto-compact from time to time and on close - auto-compact from time to time and on close
...@@ -56,13 +58,15 @@ TODO: ...@@ -56,13 +58,15 @@ TODO:
- support background writes (concurrent modification & store) - support background writes (concurrent modification & store)
- limited support for writing to old versions (branches) - limited support for writing to old versions (branches)
- support concurrent operations (including file I/O) - support concurrent operations (including file I/O)
- on insert, if the child page is already full, don't load and modify it - split directly (for leaves with 1 entry) - on insert, if the child page is already full, don't load and modify it
-- split directly (for leaves with 1 entry)
- performance test with encrypting file system - performance test with encrypting file system
- possibly split chunk data into immutable and mutable - possibly split chunk data into immutable and mutable
- compact: avoid processing pages using a counting bloom filter - compact: avoid processing pages using a counting bloom filter
- defragment (re-creating maps, specially those with small pages) - defragment (re-creating maps, specially those with small pages)
- write using ByteArrayOutputStream; remove DataType.getMaxLength - write using ByteArrayOutputStream; remove DataType.getMaxLength
- file header: check formatRead and format (is formatRead needed if equal to format?) - file header: check formatRead and format (is formatRead
-- needed if equal to format?)
- chunk header: store changed chunk data as row; maybe after the root - chunk header: store changed chunk data as row; maybe after the root
- chunk checksum (header, last page, 2 bytes per page?) - chunk checksum (header, last page, 2 bytes per page?)
- allow renaming maps - allow renaming maps
...@@ -70,16 +74,22 @@ TODO: ...@@ -70,16 +74,22 @@ TODO:
- online backup - online backup
- MapFactory is the wrong name (StorePlugin?) or is too flexible: remove? - MapFactory is the wrong name (StorePlugin?) or is too flexible: remove?
- store file "header" at the end of each chunk; at the end of the file - store file "header" at the end of each chunk; at the end of the file
- is there a better name for the file header, if it's no longer always at the beginning of a file? - is there a better name for the file header,
- maybe let a chunk point to possible next chunks (so no fixed location header is needed) -- if it's no longer always at the beginning of a file?
- maybe let a chunk point to possible next chunks
-- (so no fixed location header is needed)
- support stores that span multiple files (chunks stored in other files) - support stores that span multiple files (chunks stored in other files)
- triggers (can be implemented with a custom map) - triggers (can be implemented with a custom map)
- store write operations per page (maybe defragment if much different than count) - store write operations per page (maybe defragment
-- if much different than count)
- r-tree: nearest neighbor search - r-tree: nearest neighbor search
- use FileChannel by default (nio file system), but: an interrupt close the FileChannel - use FileChannel by default (nio file system), but:
- auto-save temporary data if it uses too much memory, but revert it on startup if needed. -- an interrupt close the FileChannel
- auto-save temporary data if it uses too much memory,
-- but revert it on startup if needed.
- map and chunk metadata: do not store default values - map and chunk metadata: do not store default values
- support maps without values (non-unique indexes), and maps without keys (counted b-tree) - support maps without values (non-unique indexes),
- and maps without keys (counted b-tree)
- use a small object cache (StringCache) - use a small object cache (StringCache)
- dump values - dump values
- tool to import / manipulate CSV files - tool to import / manipulate CSV files
...@@ -96,6 +106,10 @@ public class MVStore { ...@@ -96,6 +106,10 @@ public class MVStore {
*/ */
public static final boolean ASSERT = false; public static final boolean ASSERT = false;
/**
* The block size (physical sector size) of the disk. The file header is
* written twice, one copy in each block, to ensure it survives a crash.
*/
static final int BLOCK_SIZE = 4 * 1024; static final int BLOCK_SIZE = 4 * 1024;
private final HashMap<String, Object> config; private final HashMap<String, Object> config;
...@@ -192,6 +206,7 @@ public class MVStore { ...@@ -192,6 +206,7 @@ public class MVStore {
* *
* @param version the version * @param version the version
* @param name the map name * @param name the map name
* @param template the template map
* @return the read-only map * @return the read-only map
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
...@@ -326,10 +341,6 @@ public class MVStore { ...@@ -326,10 +341,6 @@ public class MVStore {
mapsChanged.remove(map.getId()); mapsChanged.remove(map.getId());
} }
boolean isMetaMap(MVMap<?, ?> map) {
return map == meta;
}
private DataType getDataType(Class<?> clazz) { private DataType getDataType(Class<?> clazz) {
if (clazz == String.class) { if (clazz == String.class) {
return StringType.INSTANCE; return StringType.INSTANCE;
...@@ -351,6 +362,9 @@ public class MVStore { ...@@ -351,6 +362,9 @@ public class MVStore {
mapsChanged.put(map.getId(), map); mapsChanged.put(map.getId(), map);
} }
/**
* Open the store.
*/
void open() { void open() {
meta = new MVMap<String, String>(StringType.INSTANCE, StringType.INSTANCE); meta = new MVMap<String, String>(StringType.INSTANCE, StringType.INSTANCE);
HashMap<String, String> c = New.hashMap(); HashMap<String, String> c = New.hashMap();
...@@ -1090,6 +1104,9 @@ public class MVStore { ...@@ -1090,6 +1104,9 @@ public class MVStore {
return unsavedPageCount; return unsavedPageCount;
} }
/**
* Increment the number of unsaved pages.
*/
void registerUnsavedPage() { void registerUnsavedPage() {
unsavedPageCount++; unsavedPageCount++;
} }
......
...@@ -75,6 +75,12 @@ public class MVStoreBuilder { ...@@ -75,6 +75,12 @@ public class MVStoreBuilder {
return set("cacheSize", Integer.toString(mb)); return set("cacheSize", Integer.toString(mb));
} }
/**
* Use the given data type factory.
*
* @param factory the data type factory
* @return this
*/
public MVStoreBuilder with(DataTypeFactory factory) { public MVStoreBuilder with(DataTypeFactory factory) {
return set("dataTypeFactory", factory); return set("dataTypeFactory", factory);
} }
...@@ -94,6 +100,12 @@ public class MVStoreBuilder { ...@@ -94,6 +100,12 @@ public class MVStoreBuilder {
return DataUtils.appendMap(new StringBuilder(), config).toString(); return DataUtils.appendMap(new StringBuilder(), config).toString();
} }
/**
* Read the configuration from a string.
*
* @param s the string representation
* @return the builder
*/
public static MVStoreBuilder fromString(String s) { public static MVStoreBuilder fromString(String s) {
HashMap<String, String> config = DataUtils.parseMap(s); HashMap<String, String> config = DataUtils.parseMap(s);
MVStoreBuilder builder = new MVStoreBuilder(); MVStoreBuilder builder = new MVStoreBuilder();
......
...@@ -94,6 +94,7 @@ public class Page { ...@@ -94,6 +94,7 @@ public class Page {
* @param counts the children counts * @param counts the children counts
* @param totalCount the total number of keys * @param totalCount the total number of keys
* @param sharedFlags which arrays are shared * @param sharedFlags which arrays are shared
* @param memory the memory used in bytes
* @return the page * @return the page
*/ */
public static Page create(MVMap<?, ?> map, long version, public static Page create(MVMap<?, ?> map, long version,
...@@ -119,8 +120,9 @@ public class Page { ...@@ -119,8 +120,9 @@ public class Page {
* *
* @param file the file * @param file the file
* @param map the map * @param map the map
* @param filePos the position in the file
* @param pos the page position * @param pos the page position
* @param filePos the position in the file
* @param fileSize the file size (to avoid reading past EOF)
* @return the page * @return the page
*/ */
static Page read(FileChannel file, MVMap<?, ?> map, static Page read(FileChannel file, MVMap<?, ?> map,
...@@ -414,6 +416,12 @@ public class Page { ...@@ -414,6 +416,12 @@ public class Page {
return totalCount; return totalCount;
} }
/**
* Get the descendant counts for the given child.
*
* @param index the child index
* @return the descendant count
*/
long getCounts(int index) { long getCounts(int index) {
return counts[index]; return counts[index];
} }
...@@ -633,6 +641,14 @@ public class Page { ...@@ -633,6 +641,14 @@ public class Page {
} }
} }
/**
* Read the page from the buffer.
*
* @param buff the buffer
* @param chunkId the chunk id
* @param offset the offset within the chunk
* @param maxLength the maximum length
*/
void read(ByteBuffer buff, int chunkId, int offset, int maxLength) { void read(ByteBuffer buff, int chunkId, int offset, int maxLength) {
int start = buff.position(); int start = buff.position();
int pageLength = buff.getInt(); int pageLength = buff.getInt();
......
...@@ -263,6 +263,12 @@ public class StreamStore { ...@@ -263,6 +263,12 @@ public class StreamStore {
return new Stream(this, id); return new Stream(this, id);
} }
/**
* Get the block.
*
* @param key the key
* @return the block
*/
byte[] getBlock(long key) { byte[] getBlock(long key) {
return map.get(key); return map.get(key);
} }
......
...@@ -22,7 +22,11 @@ import org.h2.util.New; ...@@ -22,7 +22,11 @@ import org.h2.util.New;
*/ */
public class MVRTreeMap<V> extends MVMap<SpatialKey, V> { public class MVRTreeMap<V> extends MVMap<SpatialKey, V> {
/**
* The spatial key type.
*/
final SpatialType keyType; final SpatialType keyType;
private boolean quadraticSplit; private boolean quadraticSplit;
public MVRTreeMap(int dimensions, DataType valueType) { public MVRTreeMap(int dimensions, DataType valueType) {
...@@ -30,6 +34,14 @@ public class MVRTreeMap<V> extends MVMap<SpatialKey, V> { ...@@ -30,6 +34,14 @@ public class MVRTreeMap<V> extends MVMap<SpatialKey, V> {
this.keyType = (SpatialType) getKeyType(); this.keyType = (SpatialType) getKeyType();
} }
/**
* Create a new map with the given dimensions and value type.
*
* @param <V> the value type
* @param dimensions the number of dimensions
* @param valueType the value type
* @return the map
*/
public static <V> MVRTreeMap<V> create(int dimensions, DataType valueType) { public static <V> MVRTreeMap<V> create(int dimensions, DataType valueType) {
return new MVRTreeMap<V>(dimensions, valueType); return new MVRTreeMap<V>(dimensions, valueType);
} }
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
and under the Eclipse Public License, Version 1.0
(http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>
Javadoc package documentation
</title></head><body style="font: 9pt/130% Tahoma, Arial, Helvetica, sans-serif; font-weight: normal;"><p>
An R-tree implementation
</p></body></html>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
and under the Eclipse Public License, Version 1.0
(http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>
Javadoc package documentation
</title></head><body style="font: 9pt/130% Tahoma, Arial, Helvetica, sans-serif; font-weight: normal;"><p>
Data types and serialization / deserialization
</p></body></html>
\ No newline at end of file
...@@ -32,8 +32,8 @@ public class ClassUtils { ...@@ -32,8 +32,8 @@ public class ClassUtils {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <T> T newObject(Class<T> clazz) { public static <T> T newObject(Class<T> clazz) {
// must create new instances, cannot use methods like Boolean.FALSE, since the caller relies // must create new instances, cannot use methods like Boolean.FALSE,
// on this creating unique objects // since the caller relies on this creating unique objects
if (clazz == Integer.class) { if (clazz == Integer.class) {
return (T) new Integer((int) COUNTER.getAndIncrement()); return (T) new Integer((int) COUNTER.getAndIncrement());
} else if (clazz == String.class) { } else if (clazz == String.class) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论