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

--no commit message

--no commit message
上级 bd3ced2d
...@@ -54,6 +54,8 @@ Advanced Topics ...@@ -54,6 +54,8 @@ Advanced Topics
Restricting Class Loading and Usage</a><br /> Restricting Class Loading and Usage</a><br />
<a href="#security_protocols"> <a href="#security_protocols">
Security Protocols</a><br /> Security Protocols</a><br />
<a href="#ssl_tls_connections">
SSL/TLS Connections</a><br />
<a href="#uuid"> <a href="#uuid">
Universally Unique Identifiers (UUID)</a><br /> Universally Unique Identifiers (UUID)</a><br />
<a href="#system_properties"> <a href="#system_properties">
...@@ -126,14 +128,9 @@ NULL and values that are not set in the insert statement are both inserted as NU ...@@ -126,14 +128,9 @@ NULL and values that are not set in the insert statement are both inserted as NU
This may not have the desired effect if a default value in the target table is other than NULL. This may not have the desired effect if a default value in the target table is other than NULL.
</p> </p>
<p> <p>
For each linked table a new connection is opened. This can be a problem for some databases when using If multiple linked tables point to the same database (using the same database URL), the connection
many linked tables. For Oracle XE, the maximum number of connection can be increased. is shared. To disable this, set the system property h2.shareLinkedConnections to false.
Oracle XE needs to be restarted after changing these values:
</p> </p>
<pre>
alter system set processes=100 scope=spfile;
alter system set sessions=100 scope=spfile;
</pre>
<p> <p>
The CREATE LINKED TABLE statement supports an optional schema name parameter. The CREATE LINKED TABLE statement supports an optional schema name parameter.
See the grammar for details. See the grammar for details.
...@@ -990,7 +987,15 @@ so that an attacker needs to wait for the whole delay. Delays are synchronized. ...@@ -990,7 +987,15 @@ so that an attacker needs to wait for the whole delay. Delays are synchronized.
to protect against parallel attacks. to protect against parallel attacks.
</p> </p>
<h3>SSL/TLS Connections</h3> <h3>HTTPS Connections</h3>
<p>
The web server supports HTTP and HTTPS connections using SSLServerSocket.
There is a default self-certified certificate to support an easy starting point, but
custom certificates are supported as well.
</p>
<br /><a name="ssl_tls_connections"></a>
<h2>SSL/TLS Connections</h2>
<p> <p>
Remote SSL/TLS connections are supported using the Java Secure Socket Extension Remote SSL/TLS connections are supported using the Java Secure Socket Extension
(SSLServerSocket / SSLSocket). By default, anonymous SSL is enabled. (SSLServerSocket / SSLSocket). By default, anonymous SSL is enabled.
...@@ -1007,13 +1012,6 @@ for more information. ...@@ -1007,13 +1012,6 @@ for more information.
To disable anonymous SSL, set the system property <code>h2.enableAnonymousSSL</code> to false. To disable anonymous SSL, set the system property <code>h2.enableAnonymousSSL</code> to false.
</p> </p>
<h3>HTTPS Connections</h3>
<p>
The web server supports HTTP and HTTPS connections using SSLServerSocket.
There is a default self-certified certificate to support an easy starting point, but
custom certificates are supported as well.
</p>
<br /><a name="uuid"></a> <br /><a name="uuid"></a>
<h2>Universally Unique Identifiers (UUID)</h2> <h2>Universally Unique Identifiers (UUID)</h2>
<p> <p>
......
...@@ -20,7 +20,7 @@ Change Log ...@@ -20,7 +20,7 @@ Change Log
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul><li>Opening large database is now faster. <ul><li>Opening large database is now faster.
</li><li>New system property h2.socketConnectTimeout, the timeout in milliseconds </li><li>New system property h2.socketConnectTimeout, the timeout in milliseconds
to connect to a server. The default is 2000 (2 seconds). to connect to a server. The default is 2000 (2 seconds).
</li><li>The wrong parameters were bound to subqueries with parameters, specially </li><li>The wrong parameters were bound to subqueries with parameters, specially
when using IN(SELECT ...) and IN(...). when using IN(SELECT ...) and IN(...).
</li><li>Unset parameters were not detected when the query was re-compiled. </li><li>Unset parameters were not detected when the query was re-compiled.
......
...@@ -147,19 +147,14 @@ Not all such problems may be fixed. ...@@ -147,19 +147,14 @@ Not all such problems may be fixed.
Areas that are not fully tested: Areas that are not fully tested:
</p> </p>
<ul> <ul>
<li>Platforms other than Windows XP and the Sun JVM 1.4 and 1.5 <li>Platforms other than Windows XP or Linux, or JVMs other than Sun 1.4 - 1.6
</li><li>The features AUTO_SERVER and AUTO_RECONNECT
</li><li>The MVCC (multi version concurrency) mode </li><li>The MVCC (multi version concurrency) mode
</li><li>Cluster mode, 2-phase commit, savepoints </li><li>Cluster mode, 2-phase commit, savepoints
</li><li>24/7 operation </li><li>24/7 operation
</li><li>Some operations on databases larger than 500 MB may be slower than expected </li><li>Some operations on databases larger than 500 MB may be slower than expected
</li><li>Updatable result sets
</li><li>Referential integrity and check constraints, triggers
</li><li>ALTER TABLE statements, views, linked tables, schema, UNION
</li><li>Not all built-in functions are completely tested
</li><li>The optimizer may not always select the best plan
</li><li>Data types BLOB, CLOB, VARCHAR_IGNORECASE, OTHER
</li><li>Wide indexes with large VARCHAR or VARBINARY columns and / or with a lot of columns
</li><li>Multi-threading and using multiple connections </li><li>Multi-threading and using multiple connections
</li><li>The optimizer may not always select the best plan
</li></ul> </li></ul>
<p> <p>
......
...@@ -29,6 +29,8 @@ Features ...@@ -29,6 +29,8 @@ Features
Connection Modes</a><br /> Connection Modes</a><br />
<a href="#database_url"> <a href="#database_url">
Database URL Overview</a><br /> Database URL Overview</a><br />
<a href="#embedded_databases">
Connecting to an Embedded (Local) Database</a><br />
<a href="#memory_only_databases"> <a href="#memory_only_databases">
Memory-Only Databases</a><br /> Memory-Only Databases</a><br />
<a href="#file_encryption"> <a href="#file_encryption">
...@@ -39,6 +41,10 @@ Features ...@@ -39,6 +41,10 @@ Features
Opening a Database Only if it Already Exists</a><br /> Opening a Database Only if it Already Exists</a><br />
<a href="#closing_the_database"> <a href="#closing_the_database">
Closing the Database</a><br /> Closing the Database</a><br />
<a href="#ignore_unknown_settings">
Ignore Unknown Settings</a><br />
<a href="#other_settings">
Changing Other Settings when Opening a Connection</a><br />
<a href="#log_index_changes"> <a href="#log_index_changes">
Log Index Changes</a><br /> Log Index Changes</a><br />
<a href="#custom_access_mode"> <a href="#custom_access_mode">
...@@ -51,6 +57,10 @@ Features ...@@ -51,6 +57,10 @@ Features
Logging and Recovery</a><br /> Logging and Recovery</a><br />
<a href="#compatibility"> <a href="#compatibility">
Compatibility</a><br /> Compatibility</a><br />
<a href="#auto_reconnect">
Auto-Reconnect</a><br />
<a href="#auto_mixed_mode">
Automatic Mixed Mode</a><br />
<a href="#trace_options"> <a href="#trace_options">
Using the Trace Options</a><br /> Using the Trace Options</a><br />
<a href="#other_logging"> <a href="#other_logging">
...@@ -364,7 +374,7 @@ http://groups.google.com/group/h2-database/web/roadmap ...@@ -364,7 +374,7 @@ http://groups.google.com/group/h2-database/web/roadmap
<h3>Derby and HSQLDB</h3> <h3>Derby and HSQLDB</h3>
<p> <p>
After an unexpected process termination (for example power failure), H2 can recover safely and After an unexpected process termination (for example power failure), H2 can recover safely and
automatically without any user interaction. For Derby and HSQLDB, there are some manual steps required automatically without any user interaction. For Derby and HSQLDB, some manual steps are required
('Another instance of Derby may have already booted the database' / ('Another instance of Derby may have already booted the database' /
'The database is already in use by another process'). 'The database is already in use by another process').
</p> </p>
...@@ -444,7 +454,7 @@ This is achieved using different database URLs. Settings in the URLs are not cas ...@@ -444,7 +454,7 @@ This is achieved using different database URLs. Settings in the URLs are not cas
</p> </p>
<table><tr><th>Topic</th><th>URL Format and Examples</th></tr> <table><tr><th>Topic</th><th>URL Format and Examples</th></tr>
<tr> <tr>
<td>Embedded (local) connection</td> <td><a href="#embedded_databases">Embedded (local) connection</a></td>
<td> <td>
jdbc:h2:[file:][&lt;path&gt;]&lt;databaseName&gt;<br /> jdbc:h2:[file:][&lt;path&gt;]&lt;databaseName&gt;<br />
jdbc:h2:~/test<br /> jdbc:h2:~/test<br />
...@@ -453,18 +463,18 @@ This is achieved using different database URLs. Settings in the URLs are not cas ...@@ -453,18 +463,18 @@ This is achieved using different database URLs. Settings in the URLs are not cas
</td> </td>
</tr> </tr>
<tr> <tr>
<td>In-Memory (private)</td> <td><a href="#memory_only_databases">In-Memory (private)</a></td>
<td>jdbc:h2:mem:</td> <td>jdbc:h2:mem:</td>
</tr> </tr>
<tr> <tr>
<td>In-Memory (named)</td> <td><a href="#memory_only_databases">In-Memory (named)</a></td>
<td> <td>
jdbc:h2:mem:&lt;databaseName&gt;<br /> jdbc:h2:mem:&lt;databaseName&gt;<br />
jdbc:h2:mem:test_mem jdbc:h2:mem:test_mem
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Remote using TCP/IP</td> <td><a href="tutorial.html#using_server">Remote using TCP/IP</a></td>
<td> <td>
jdbc:h2:tcp://&lt;server&gt;[:&lt;port&gt;]/&lt;databaseName&gt;<br /> jdbc:h2:tcp://&lt;server&gt;[:&lt;port&gt;]/&lt;databaseName&gt;<br />
jdbc:h2:tcp://localhost/~/test<br /> jdbc:h2:tcp://localhost/~/test<br />
...@@ -472,14 +482,14 @@ This is achieved using different database URLs. Settings in the URLs are not cas ...@@ -472,14 +482,14 @@ This is achieved using different database URLs. Settings in the URLs are not cas
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Remote using SSL/TLS</td> <td><a href="advanced.html#ssl_tls_connections">Remote using SSL/TLS</a></td>
<td> <td>
jdbc:h2:ssl://&lt;server&gt;[:&lt;port&gt;]/&lt;databaseName&gt;<br /> jdbc:h2:ssl://&lt;server&gt;[:&lt;port&gt;]/&lt;databaseName&gt;<br />
jdbc:h2:ssl://secureserv:8085/~/sample; jdbc:h2:ssl://secureserv:8085/~/sample;
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Using Encrypted Files</td> <td><a href="#file_encryption">Using Encrypted Files</a></td>
<td> <td>
jdbc:h2:&lt;url&gt;;CIPHER=[AES|XTEA]<br /> jdbc:h2:&lt;url&gt;;CIPHER=[AES|XTEA]<br />
jdbc:h2:ssl://secureserv/~/testdb;CIPHER=AES<br /> jdbc:h2:ssl://secureserv/~/testdb;CIPHER=AES<br />
...@@ -487,7 +497,7 @@ This is achieved using different database URLs. Settings in the URLs are not cas ...@@ -487,7 +497,7 @@ This is achieved using different database URLs. Settings in the URLs are not cas
</td> </td>
</tr> </tr>
<tr> <tr>
<td>File Locking Methods</td> <td><a href="#database_file_locking">File Locking Methods</a></td>
<td> <td>
jdbc:h2:&lt;url&gt;;FILE_LOCK={NO|FILE|SOCKET}<br /> jdbc:h2:&lt;url&gt;;FILE_LOCK={NO|FILE|SOCKET}<br />
jdbc:h2:file:~/quickAndDirty;FILE_LOCK=NO<br /> jdbc:h2:file:~/quickAndDirty;FILE_LOCK=NO<br />
...@@ -495,64 +505,81 @@ This is achieved using different database URLs. Settings in the URLs are not cas ...@@ -495,64 +505,81 @@ This is achieved using different database URLs. Settings in the URLs are not cas
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Only Open if it Already Exists</td> <td><a href="#database_only_if_exists">Only Open if it Already Exists</a></td>
<td> <td>
jdbc:h2:&lt;url&gt;;IFEXISTS=TRUE<br /> jdbc:h2:&lt;url&gt;;IFEXISTS=TRUE<br />
jdbc:h2:file:~/sample;IFEXISTS=TRUE<br /> jdbc:h2:file:~/sample;IFEXISTS=TRUE<br />
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Don't Close the Database when the VM Exits</td> <td><a href="#do_not_close_on_exit">Don't Close the Database when the VM Exits</a></td>
<td> <td>
jdbc:h2:&lt;url&gt;;DB_CLOSE_ON_EXIT=FALSE jdbc:h2:&lt;url&gt;;DB_CLOSE_ON_EXIT=FALSE
</td> </td>
</tr> </tr>
<tr> <tr>
<td>User Name and/or Password</td> <td><a href="#passwords">User Name and/or Password</a></td>
<td> <td>
jdbc:h2:&lt;url&gt;[;USER=&lt;username&gt;][;PASSWORD=&lt;value&gt;]<br /> jdbc:h2:&lt;url&gt;[;USER=&lt;username&gt;][;PASSWORD=&lt;value&gt;]<br />
jdbc:h2:file:~/sample;USER=sa;PASSWORD=123<br /> jdbc:h2:file:~/sample;USER=sa;PASSWORD=123<br />
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Log Index Changes</td> <td><a href="#log_index_changes">Log Index Changes</a></td>
<td> <td>
jdbc:h2:&lt;url&gt;;LOG=2<br /> jdbc:h2:&lt;url&gt;;LOG=2<br />
jdbc:h2:file:~/sample;LOG=2<br /> jdbc:h2:file:~/sample;LOG=2<br />
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Debug Trace Settings</td> <td><a href="#trace_options">Debug Trace Settings</a></td>
<td> <td>
jdbc:h2:&lt;url&gt;;TRACE_LEVEL_FILE=&lt;level 0..3&gt;<br /> jdbc:h2:&lt;url&gt;;TRACE_LEVEL_FILE=&lt;level 0..3&gt;<br />
jdbc:h2:file:~/sample;TRACE_LEVEL_FILE=3<br /> jdbc:h2:file:~/sample;TRACE_LEVEL_FILE=3<br />
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Ignore Unknown Settings</td> <td><a href="#ignore_unknown_settings">Ignore Unknown Settings</a></td>
<td> <td>
jdbc:h2:&lt;url&gt;;IGNORE_UNKNOWN_SETTINGS=TRUE<br /> jdbc:h2:&lt;url&gt;;IGNORE_UNKNOWN_SETTINGS=TRUE<br />
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Custom File Access Mode</td> <td><a href="#custom_access_mode">Custom File Access Mode</a></td>
<td> <td>
jdbc:h2:&lt;url&gt;;ACCESS_MODE_LOG=rws;ACCESS_MODE_DATA=rws<br /> jdbc:h2:&lt;url&gt;;ACCESS_MODE_LOG=rws;ACCESS_MODE_DATA=rws<br />
</td> </td>
</tr> </tr>
<tr> <tr>
<td>In-Memory (private)</td> <td><a href="#database_in_zip">Database in or Zip File</a></td>
<td>jdbc:h2:mem:</td>
</tr>
<tr>
<td>Database in or Zip File</td>
<td> <td>
jdbc:h2:zip:&lt;zipFileName&gt;!/&lt;databaseName&gt;<br /> jdbc:h2:zip:&lt;zipFileName&gt;!/&lt;databaseName&gt;<br />
jdbc:h2:zip:~/db.zip!/test jdbc:h2:zip:~/db.zip!/test
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Changing Other Settings</td> <td><a href="#compatibility">Compatibility Mode</a></td>
<td>
jdbc:h2:&lt;url&gt;;MODE=&lt;databaseType&gt;<br />
jdbc:h2:~/test;MODE=MYSQL
</td>
</tr>
<tr>
<td><a href="#auto_reconnect">Auto-Reconnect</a></td>
<td>
jdbc:h2:&lt;url&gt;;AUTO_RECONNECT=TRUE<br />
jdbc:h2:tcp://localhost/~/test;AUTO_RECONNECT=TRUE
</td>
</tr>
<tr>
<td><a href="#auto_mixed_mode">Automatic Mixed Mode</td>
<td>
jdbc:h2:&lt;url&gt;;AUTO_SERVER=TRUE<br />
jdbc:h2:~/test;AUTO_SERVER=TRUE
</td>
</tr>
<tr>
<td><a href="#other_settings">Changing Other Settings</a></td>
<td> <td>
jdbc:h2:&lt;url&gt;;&lt;setting&gt;=&lt;value&gt;[;&lt;setting&gt;=&lt;value&gt;...]<br /> jdbc:h2:&lt;url&gt;;&lt;setting&gt;=&lt;value&gt;[;&lt;setting&gt;=&lt;value&gt;...]<br />
jdbc:h2:file:~/sample;TRACE_LEVEL_SYSTEM_OUT=3<br /> jdbc:h2:file:~/sample;TRACE_LEVEL_SYSTEM_OUT=3<br />
...@@ -560,7 +587,8 @@ This is achieved using different database URLs. Settings in the URLs are not cas ...@@ -560,7 +587,8 @@ This is achieved using different database URLs. Settings in the URLs are not cas
</tr> </tr>
</table> </table>
<h3>Connecting to an Embedded (Local) Database</h3> <br /><a name="embedded_databases"></a>
<h2>Connecting to an Embedded (Local) Database</h2>
<p> <p>
The database URL for connecting to a local database is <code>jdbc:h2:[file:][&lt;path&gt;]&lt;databaseName&gt;</code>. The database URL for connecting to a local database is <code>jdbc:h2:[file:][&lt;path&gt;]&lt;databaseName&gt;</code>.
The prefix <code>file:</code> is optional. If no or only a relative path is used, then the current working The prefix <code>file:</code> is optional. If no or only a relative path is used, then the current working
...@@ -693,6 +721,7 @@ This setting is persistent and can be set by an administrator only. ...@@ -693,6 +721,7 @@ This setting is persistent and can be set by an administrator only.
It is possible to set the value in the database URL: <code>jdbc:h2:~/test;DB_CLOSE_DELAY=10</code>. It is possible to set the value in the database URL: <code>jdbc:h2:~/test;DB_CLOSE_DELAY=10</code>.
</p> </p>
<br /><a name="do_not_close_on_exit"></a>
<h3>Don't Close the Database when the VM Exits</h3> <h3>Don't Close the Database when the VM Exits</h3>
<p> <p>
By default, a database is closed when the last connection is closed. However, if it is never closed, By default, a database is closed when the last connection is closed. However, if it is never closed,
...@@ -724,7 +753,8 @@ This setting should be specified when connecting. ...@@ -724,7 +753,8 @@ This setting should be specified when connecting.
The update performance of the database will be reduced when using this option. The update performance of the database will be reduced when using this option.
</p> </p>
<h3>Ignore Unknown Settings</h3> <br /><a name="ignore_unknown_settings"></a>
<h2>Ignore Unknown Settings</h2>
<p> <p>
Some applications (for example OpenOffice.org Base) pass some additional parameters Some applications (for example OpenOffice.org Base) pass some additional parameters
when connecting to the database. Why those parameters are passed is unknown. when connecting to the database. Why those parameters are passed is unknown.
...@@ -735,7 +765,8 @@ saying the parameter is not supported. It is possible to ignored such parameters ...@@ -735,7 +765,8 @@ saying the parameter is not supported. It is possible to ignored such parameters
;IGNORE_UNKNOWN_SETTINGS=TRUE to the database URL. ;IGNORE_UNKNOWN_SETTINGS=TRUE to the database URL.
</p> </p>
<h3>Changing Other Settings when Opening a Connection</h3> <br /><a name="other_settings"></a>
<h2>Changing Other Settings when Opening a Connection</h2>
<p> <p>
In addition to the settings already described (cipher, file_lock, ifexists, user, password), In addition to the settings already described (cipher, file_lock, ifexists, user, password),
other database settings can be passed in the database URL. other database settings can be passed in the database URL.
...@@ -1090,6 +1121,40 @@ or the SQL statement <code>SET MODE Oracle</code>. ...@@ -1090,6 +1121,40 @@ or the SQL statement <code>SET MODE Oracle</code>.
and getTableName() returns null. and getTableName() returns null.
</li></ul> </li></ul>
<br /><a name="auto_reconnect"></a>
<h2>Auto-Reconnect</h2>
<p>
The auto-reconnect feature causes the JDBC driver to reconnect to
the database if the connection is lost. The automatic re-connect only
occurs when auto-commit is enabled; if auto-commit is disabled, an exception is thrown.
</p>
<p>
Re-connecting will open a new session. After an automatic re-connect,
variables and local temporary tables definitions (excluding data) are re-created.
The contents of the system table INFORMATION_SCHEMA.SESSION_STATE
contains all client side state that is re-created.
</p>
<br /><a name="auto_mixed_mode"></a>
<h2>Automatic Mixed Mode</h2>
<p>
Multiple processes can access the same database without having to explicitly
start the server. To do that, append <code>;AUTO_SERVER=TRUE</code> to the database URL.
In this case, the first connection to the database is made in embedded mode, and additionally a server is started.
If the database is already open in another process, the server mode is used.
</p>
<p>
When using this feature, auto-reconnect is enabled as well.
</p>
<p>
The application that opens the first connection to the database uses the embedded mode,
which is faster than the server mode. Therefore the main application should open
the database first if possible. A server is started on a random port.
This server allows remote connections, however only to this database.
In addition to the user name and password, the client sends the random key that is
stored in .lock.db file to the server.
</p>
<br /><a name="trace_options"></a> <br /><a name="trace_options"></a>
<h2>Using the Trace Options</h2> <h2>Using the Trace Options</h2>
<p> <p>
......
...@@ -29,8 +29,9 @@ Of course, patches are always welcome, but are not always applied as is. Patches ...@@ -29,8 +29,9 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>RECOVER=1 should automatically recover, =2 should run the recovery tool if required </li><li>RECOVER=1 should automatically recover, =2 should run the recovery tool if required
</li><li>Test with Spatial DB in a box / JTS (http://docs.codehaus.org/display/GEOS/SpatialDBBox) </li><li>Test with Spatial DB in a box / JTS (http://docs.codehaus.org/display/GEOS/SpatialDBBox)
</li><li>Optimization: result set caching (like MySQL) </li><li>Optimization: result set caching (like MySQL)
</li><li>Server side cursors </li><li>Support large updates (use the transaction log to undo).
</li><li>Shutdown compact </li><li>Shutdown compact
</li><li>Server side cursors
</li></ul> </li></ul>
<h2>Priority 2</h2> <h2>Priority 2</h2>
...@@ -44,7 +45,6 @@ Of course, patches are always welcome, but are not always applied as is. Patches ...@@ -44,7 +45,6 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>Optimize .. OR .. to UNION if the cost is lower </li><li>Optimize .. OR .. to UNION if the cost is lower
</li><li>Index organized tables CREATE TABLE...(...) ORGANIZATION INDEX (store in data file) (probably file format changes are required for rowId) </li><li>Index organized tables CREATE TABLE...(...) ORGANIZATION INDEX (store in data file) (probably file format changes are required for rowId)
</li><li>Better space re-use in the files after deleting data: shrink the data file without closing the database (if the end of the file is empty) </li><li>Better space re-use in the files after deleting data: shrink the data file without closing the database (if the end of the file is empty)
</li><li>Support large updates (use the transaction log to undo).
</li><li>Full outer joins </li><li>Full outer joins
</li><li>Support trigger on the tables information_schema.tables and ...columns </li><li>Support trigger on the tables information_schema.tables and ...columns
</li><li>Test very large databases and LOBs (up to 256 GB) </li><li>Test very large databases and LOBs (up to 256 GB)
...@@ -98,7 +98,6 @@ Of course, patches are always welcome, but are not always applied as is. Patches ...@@ -98,7 +98,6 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>Linked schema using CSV files: one schema for a directory of files; support indexes for CSV files </li><li>Linked schema using CSV files: one schema for a directory of files; support indexes for CSV files
</li><li>Don't write stack traces for common exceptions like duplicate key to the log by default </li><li>Don't write stack traces for common exceptions like duplicate key to the log by default
</li><li>GCJ: what is the state now? </li><li>GCJ: what is the state now?
</li><li>Use Janino to convert Java to C++
</li><li>Reduce disk space usage </li><li>Reduce disk space usage
</li><li>Events for: Database Startup, Connections, Login attempts, Disconnections, Prepare (after parsing), Web Server (see http://docs.openlinksw.com/virtuoso/fn_dbev_startup.html) </li><li>Events for: Database Startup, Connections, Login attempts, Disconnections, Prepare (after parsing), Web Server (see http://docs.openlinksw.com/virtuoso/fn_dbev_startup.html)
</li><li>Optimization: Log compression </li><li>Optimization: Log compression
...@@ -111,6 +110,7 @@ Of course, patches are always welcome, but are not always applied as is. Patches ...@@ -111,6 +110,7 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>EXE file: maybe use http://jsmooth.sourceforge.net </li><li>EXE file: maybe use http://jsmooth.sourceforge.net
</li><li>Performance: Automatically build in-memory indexes if the whole table is in memory </li><li>Performance: Automatically build in-memory indexes if the whole table is in memory
</li><li>H2 Console: The webclient could support more features like phpMyAdmin. </li><li>H2 Console: The webclient could support more features like phpMyAdmin.
</li><li>Use Janino to convert Java to C++
</li><li>The HELP information schema can be directly exposed in the Console </li><li>The HELP information schema can be directly exposed in the Console
</li><li>Maybe use the 0x1234 notation for binary fields, see MS SQL Server </li><li>Maybe use the 0x1234 notation for binary fields, see MS SQL Server
</li><li>Support Oracle CONNECT BY in some way: http://www.adp-gmbh.ch/ora/sql/connect_by.html, http://philip.greenspun.com/sql/trees.html </li><li>Support Oracle CONNECT BY in some way: http://www.adp-gmbh.ch/ora/sql/connect_by.html, http://philip.greenspun.com/sql/trees.html
...@@ -349,7 +349,7 @@ Of course, patches are always welcome, but are not always applied as is. Patches ...@@ -349,7 +349,7 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>Enable warning for 'Local variable declaration hides another field or variable'. </li><li>Enable warning for 'Local variable declaration hides another field or variable'.
</li><li>Linked tables: make hidden columns available (Oracle: rowid and ora_rowscn columns). </li><li>Linked tables: make hidden columns available (Oracle: rowid and ora_rowscn columns).
</li><li>Support merge join. </li><li>Support merge join.
</li><li>H2 Console: in-place autocomplete (need to merge query and result frame, use div). </li><li>H2 Console: in-place autocomplete.
</li><li>MySQL compatibility: update test1 t1, test2 t2 set t1.id = t2.id where t1.id = t2.id; </li><li>MySQL compatibility: update test1 t1, test2 t2 set t1.id = t2.id where t1.id = t2.id;
</li><li>Oracle: support DECODE method (convert to CASE WHEN). </li><li>Oracle: support DECODE method (convert to CASE WHEN).
</li><li>Support large databases: split LOB (BLOB, CLOB) to multiple directories / disks (similar to tablespaces). </li><li>Support large databases: split LOB (BLOB, CLOB) to multiple directories / disks (similar to tablespaces).
...@@ -358,6 +358,7 @@ Of course, patches are always welcome, but are not always applied as is. Patches ...@@ -358,6 +358,7 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>H2 Console: support configuration option for fixed width (monospace) font. </li><li>H2 Console: support configuration option for fixed width (monospace) font.
</li><li>Native fulltext search: support analyzers (specially for Chinese, Japanese). </li><li>Native fulltext search: support analyzers (specially for Chinese, Japanese).
</li><li>Automatically compact databases from time to time (as a background process). </li><li>Automatically compact databases from time to time (as a background process).
</li><li>Support SCOPE_IDENTITY().
</li><li>Support GRANT SELECT, UPDATE ON *. </li><li>Support GRANT SELECT, UPDATE ON *.
</li><li>Test Eclipse DTP. </li><li>Test Eclipse DTP.
</li><li>Support JMX: Create an MBean for each database and server (support JConsole). </li><li>Support JMX: Create an MBean for each database and server (support JConsole).
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -414,11 +414,17 @@ Usually, for update statements, the old rows are deleted first ...@@ -414,11 +414,17 @@ Usually, for update statements, the old rows are deleted first
and then the new rows inserted. It is possible to emit update and then the new rows inserted. It is possible to emit update
statements (however this is not possible on rollback), however statements (however this is not possible on rollback), however
in this case multi-row unique key updates may not always work. in this case multi-row unique key updates may not always work.
Linked tables to the same database share one connection.
If a query is used instead of the original table name, the table is read only. If a query is used instead of the original table name, the table is read only.
To use JNDI to get the connection, the driver class must be a
javax.naming.Context (for example javax.naming.InitialContext), and the
URL must be the resource name (for example java:comp/env/jdbc/Test).
The current user owner must have admin rights. The current user owner must have admin rights.
"," ","
CREATE LINKED TABLE LINK('org.h2.Driver', 'jdbc:h2:test2', 'sa', 'sa', 'TEST'); CREATE LINKED TABLE LINK('org.h2.Driver', 'jdbc:h2:test2', 'sa', 'sa', 'TEST');
CREATE LINKED TABLE LINK('', 'jdbc:h2:test2', 'sa', 'sa', '(SELECT * FROM TEST WHERE ID>0)'); CREATE LINKED TABLE LINK('', 'jdbc:h2:test2', 'sa', 'sa', '(SELECT * FROM TEST WHERE ID>0)');
CREATE LINKED TABLE LINK('javax.naming.InitialContext',
'java:comp/env/jdbc/Test', NULL, NULL, '(SELECT * FROM TEST WHERE ID>0)');
" "
"Commands (DDL)","CREATE ROLE"," "Commands (DDL)","CREATE ROLE","
......
...@@ -46,11 +46,12 @@ public class BitField { ...@@ -46,11 +46,12 @@ public class BitField {
if (data[i] == 0) { if (data[i] == 0) {
continue; continue;
} }
for (int j = Math.max(fromIndex, i << ADDRESS_BITS); j < maxAddress; j++) { int j = Math.max(fromIndex, i << ADDRESS_BITS);
for (int end = Math.min(maxAddress, j + 64); j < end; j++) {
if (get(j)) { if (get(j)) {
return j; return j;
} }
} }
} }
return -1; return -1;
} }
...@@ -68,7 +69,8 @@ public class BitField { ...@@ -68,7 +69,8 @@ public class BitField {
if (data[i] == -1) { if (data[i] == -1) {
continue; continue;
} }
for (int j = Math.max(fromIndex, i << ADDRESS_BITS);; j++) { int j = Math.max(fromIndex, i << ADDRESS_BITS);
for (int end = j + 64; j < end; j++) {
if (!get(j)) { if (!get(j)) {
return j; return j;
} }
......
...@@ -278,14 +278,11 @@ java org.h2.test.TestAll timer ...@@ -278,14 +278,11 @@ java org.h2.test.TestAll timer
System.setProperty("h2.check2", "true"); System.setProperty("h2.check2", "true");
/* /*
test with 1.0
document shared connections for linked tables
document osgi
document url parameter auto_server document url parameter auto_server
document url parameter auto_reconnect document url parameter auto_reconnect
document url parameter open_new document url parameter open_new
osgi: create a sample application, test, document
merge join test case merge join test case
...@@ -310,12 +307,6 @@ not implemented / not tested ...@@ -310,12 +307,6 @@ not implemented / not tested
- keep identity, getGeneratedKeys on client - keep identity, getGeneratedKeys on client
- throw error when in cluster mode - throw error when in cluster mode
Feature requests:
SCOPE_IDENTITY
Add version number. Install directory: h2-1.1, jar file: h2-1.1.100.jar.
Micro version: use build number, staring with 1.1.100
TestMVCC: TestMVCC:
Concurrent update in table test: another transaction has updated or Concurrent update in table test: another transaction has updated or
deleted the same row when exactly does it occur in other databases deleted the same row when exactly does it occur in other databases
......
...@@ -27,11 +27,42 @@ public class TestBitField extends TestBase { ...@@ -27,11 +27,42 @@ public class TestBitField extends TestBase {
} }
public void test() { public void test() {
testNextClearBit();
testNextSetBit();
testByteOperations(); testByteOperations();
testRandom(); testRandom();
testGetSet(); testGetSet();
} }
private void testNextSetBit() {
Random random = new Random(1);
BitField field = new BitField();
for (int i = 0; i < 100000; i++) {
int a = random.nextInt(120);
int b = a + 1 + random.nextInt(200);
field.set(a);
field.set(b);
assertEquals(b, field.nextSetBit(a + 1));
field.clear(a);
field.clear(b);
}
}
private void testNextClearBit() {
Random random = new Random(1);
BitField field = new BitField();
field.setRange(0, 500, true);
for (int i = 0; i < 100000; i++) {
int a = random.nextInt(120);
int b = a + 1 + random.nextInt(200);
field.clear(a);
field.clear(b);
assertEquals(b, field.nextClearBit(a + 1));
field.set(a);
field.set(b);
}
}
private void testByteOperations() { private void testByteOperations() {
BitField used = new BitField(); BitField used = new BitField();
testSetFast(used, false); testSetFast(used, false);
...@@ -48,7 +79,9 @@ public class TestBitField extends TestBase { ...@@ -48,7 +79,9 @@ public class TestBitField extends TestBase {
x += 8; x += 8;
// for (int j = 0; j < 8; j++, x++) { // for (int j = 0; j < 8; j++, x++) {
// if (used.get(x) != ((mask & (1 << j)) != 0)) { // if (used.get(x) != ((mask & (1 << j)) != 0)) {
// throw Message.getInternalError("Redo failure, block: " + x + " expected in-use bit: " + used.get(x)); // throw Message.getInternalError(
// "Redo failure, block: " + x +
// " expected in-use bit: " + used.get(x));
// } // }
// } // }
} else { } else {
......
...@@ -25,7 +25,7 @@ public class ThreadDumpFilter { ...@@ -25,7 +25,7 @@ public class ThreadDumpFilter {
do { do {
System.out.println(s); System.out.println(s);
s = in.readLine(); s = in.readLine();
} while(s != null && (s.length() == 0 || "\t\"".indexOf(s.charAt(0)) >= 0)); } while(s != null && (s.length() == 0 || " \t\"".indexOf(s.charAt(0)) >= 0));
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论