提交 0867a55f authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 3c57fec3
...@@ -18,7 +18,24 @@ Change Log ...@@ -18,7 +18,24 @@ Change Log
<h1>Change Log</h1> <h1>Change Log</h1>
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul><li>Linked tables to SQLite database can now be created. <ul><li>Some internal caches did not use the LRU mechanism. Fixed
(LOB file list, optimizer cost cache, trace system, view indexes, collection keys,
compressed in-memory file system).
</li><li>Command line help of the tools now match the javadocs.
The build converts the javadocs to a resource that is read by the tool at runtime.
This should not have an effect on using the database, but it reduces duplicate
and out-of-sync documentation.
</li><li>CREATE TABLE: improved compatibility (support for UNIQUE NOT NULL).
</li><li>DatabaseMetaData.getSQLKeywords now returns the correct list.
</li><li>Deterministic user defined functions did not work when the parameter was a column. Fixed.
</li><li>JdbcConnectionPool.setLoginTimeout with 0 now uses the default timeout.
</li><li>Creating a JdbcConnectionPool has been simplified a bit.
</li><li>The built-in connection pool did not re-use connections.
Getting a connection using the built-in JdbcConnectionPool is now about 70 times faster
than opening connections using DriverManager.getConnection.
</li><li>More bugs in the server-less multi-connection mode have been fixed:
if a process terminated while writing, other open connections were blocked.
</li><li>Linked tables to SQLite database can now be created.
</li><li>Nested IN(IN(...)) didn't work. </li><li>Nested IN(IN(...)) didn't work.
</li><li>NIO storage: the nio: prefix was using memory mapped files instead of FileChannel. </li><li>NIO storage: the nio: prefix was using memory mapped files instead of FileChannel.
</li></ul> </li></ul>
......
...@@ -80,80 +80,80 @@ Welcome to H2, the Java SQL database. The main feature of H2 are: ...@@ -80,80 +80,80 @@ Welcome to H2, the Java SQL database. The main feature of H2 are:
<tr><td colspan="3" style="border: 0px; padding: 5px 0px 15px 0px;"> <tr><td colspan="3" style="border: 0px; padding: 5px 0px 15px 0px;">
<h3>Features</h3> <h3>Features</h3>
<table style="width: 425px;"><tr> <table style="width: 425px;"><tr>
<th></th> <th></th>
<th>H2</th> <th>H2</th>
<th>Derby</th> <th>Derby</th>
<th>HSQLDB</th> <th>HSQLDB</th>
<th>MySQL</th> <th>MySQL</th>
<th>PostgreSQL</th> <th>PostgreSQL</th>
</tr><tr> </tr><tr>
<td>Pure Java</td> <td>Pure Java</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareN">No</td> <td class="compareN">No</td>
<td class="compareN">No</td> <td class="compareN">No</td>
</tr><tr> </tr><tr>
<td>In-Memory Mode</td> <td>In-Memory Mode</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareN">No</td> <td class="compareN">No</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareN">No</td> <td class="compareN">No</td>
<td class="compareN">No</td> <td class="compareN">No</td>
</tr><tr> </tr><tr>
<td>Transaction Isolation</td> <td>Transaction Isolation</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareN">No</td> <td class="compareN">No</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
</tr><tr> </tr><tr>
<td>Cost Based Optimizer</td> <td>Cost Based Optimizer</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareN">No</td> <td class="compareN">No</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
</tr><tr> </tr><tr>
<td>Encrypted Database</td> <td>Encrypted Database</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareN">No</td> <td class="compareN">No</td>
<td class="compareN">No</td> <td class="compareN">No</td>
<td class="compareN">No</td> <td class="compareN">No</td>
</tr><tr> </tr><tr>
<td>ODBC Driver</td> <td>ODBC Driver</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareN">No</td> <td class="compareN">No</td>
<td class="compareN">No</td> <td class="compareN">No</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
</tr><tr> </tr><tr>
<td>Fulltext Search</td> <td>Fulltext Search</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareN">No</td> <td class="compareN">No</td>
<td class="compareN">No</td> <td class="compareN">No</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
</tr><tr> </tr><tr>
<td>Multi Version Concurrency</td> <td>Multi Version Concurrency</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
<td class="compareN">No</td> <td class="compareN">No</td>
<td class="compareN">No</td> <td class="compareN">No</td>
<td class="compareN">No</td> <td class="compareN">No</td>
<td class="compareY">Yes</td> <td class="compareY">Yes</td>
</tr><tr> </tr><tr>
<td>Footprint (jar/dll size)</td> <td>Footprint (jar/dll size)</td>
<td>~1 MB</td> <td>~1 MB</td>
<td>~2 MB</td> <td>~2 MB</td>
<td>~600 KB</td> <td>~600 KB</td>
<td>~4 MB</td> <td>~4 MB</td>
<td>~6 MB</td> <td>~6 MB</td>
</tr> </tr>
</table> </table>
<p> <p>
See also the <a href="features.html#comparison">detailed comparison</a>. See also the <a href="features.html#comparison">detailed comparison</a>.
</p> </p>
</td></tr> </td></tr>
<tr><td colspan="3" style="border: 0px; background-color: #eee;"> <tr><td colspan="3" style="border: 0px; background-color: #eee;">
......
...@@ -36,16 +36,18 @@ Of course, patches are always welcome, but are not always applied as is. Patches ...@@ -36,16 +36,18 @@ Of course, patches are always welcome, but are not always applied as is. Patches
<h2>Priority 2</h2> <h2>Priority 2</h2>
<ul> <ul>
<li>Improve test code coverage <li>Improve test code coverage
</li><li>Procedural language / script language (Java, Javascript)
</li><li>Fulltext search: support streaming CLOB data. </li><li>Fulltext search: support streaming CLOB data.
</li><li>Optimize .. OR .. to IN(..) or UNION if the cost is lower </li><li>Optimize .. OR .. to IN(..) or UNION if the cost is lower
</li><li>Test multi-threaded in-memory db access </li><li>Test multi-threaded in-memory db access
</li><li>MVCC: Select for update should only lock the selected rows. </li><li>MVCC: Select for update should only lock the selected rows.
</li><li>Procedural language / script language (Java, Javascript)
</li><li>Option to shutdown all the running servers (on the same VM). </li><li>Option to shutdown all the running servers (on the same VM).
</li><li>Optimize ID=? OR ID=?: convert to IN(...) </li><li>Optimize ID=? OR ID=?: convert to IN(...)
</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>Implement INSTEAD OF trigger (for views, tables, metadata tables). </li><li>Implement INSTEAD OF trigger (for views, tables, metadata tables).
</li><li>Triggers for metadata tables; use for PostgreSQL catalog
</li><li>Support triggers for INFORMATION_SCHEMA tables (to better support PostgreSQL catalog: rebuild after creating new tables)
</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)
...@@ -205,7 +207,7 @@ Of course, patches are always welcome, but are not always applied as is. Patches ...@@ -205,7 +207,7 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>Recursive Queries (see details) </li><li>Recursive Queries (see details)
</li><li>Release locks (shared or exclusive) on demand </li><li>Release locks (shared or exclusive) on demand
</li><li>Support OUTER UNION </li><li>Support OUTER UNION
</li><li>Support Parameterized Views (similar to CSVREAD, but using just SQL for the definition) </li><li>Support parameterized views (similar to CSVREAD, but using just SQL for the definition)
</li><li>A way (JDBC driver) to map an URL (jdbc:h2map:c1) to a connection object </li><li>A way (JDBC driver) to map an URL (jdbc:h2map:c1) to a connection object
</li><li>Option for SCRIPT to only process one or a set of tables, and append to a file </li><li>Option for SCRIPT to only process one or a set of tables, and append to a file
</li><li>Support using a unique index for IS NULL (including linked tables) </li><li>Support using a unique index for IS NULL (including linked tables)
...@@ -214,11 +216,12 @@ Of course, patches are always welcome, but are not always applied as is. Patches ...@@ -214,11 +216,12 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>Compatibility with Derby: VALUES(1), (2); SELECT * FROM (VALUES (1), (2)) AS myTable(c1) </li><li>Compatibility with Derby: VALUES(1), (2); SELECT * FROM (VALUES (1), (2)) AS myTable(c1)
</li><li>Compatibility: # is the start of a single line comment (MySQL) but date quote (Access). Mode specific </li><li>Compatibility: # is the start of a single line comment (MySQL) but date quote (Access). Mode specific
</li><li>Run benchmarks with JDK 1.5, JDK 1.6, java -server </li><li>Run benchmarks with JDK 1.5, JDK 1.6, java -server
</li><li>Optimizations: Faster hash function for strings, byte arrays, big decimal </li><li>Optimizations: Faster hash function for strings, byte arrays
</li><li>DatabaseEventListener: callback for all operations (including expected time, RUNSCRIPT) and cancel functionality </li><li>DatabaseEventListener: callback for all operations (including expected time, RUNSCRIPT) and cancel functionality
</li><li>H2 Console / large result sets: use 'streaming' instead of building the page in-memory </li><li>H2 Console / large result sets: use 'streaming' instead of building the page in-memory
</li><li>Benchmark: add a graph to show how databases scale (performance/database size) </li><li>Benchmark: add a graph to show how databases scale (performance/database size)
</li><li>Implement a SQLData interface to map your data over to a custom object </li><li>Implement a SQLData interface to map your data over to a custom object
</li><li>In the MySQL and PostgreSQL mode, use lower case identifiers by default (DatabaseMetaData.storesLowerCaseIdentifiers = true)
</li><li>Make DDL (Data Definition) operations transactional </li><li>Make DDL (Data Definition) operations transactional
</li><li>Allow execution time prepare for SELECT * FROM CSVREAD(?, 'columnNameString') </li><li>Allow execution time prepare for SELECT * FROM CSVREAD(?, 'columnNameString')
</li><li>Support multiple directories (on different hard drives) for the same database </li><li>Support multiple directories (on different hard drives) for the same database
...@@ -243,8 +246,6 @@ Of course, patches are always welcome, but are not always applied as is. Patches ...@@ -243,8 +246,6 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>In MySQL mode, for AUTO_INCREMENT columns, don't set the primary key </li><li>In MySQL mode, for AUTO_INCREMENT columns, don't set the primary key
</li><li>Use JDK 1.4 file locking to create the lock file (but not yet by default); writing a system property to detect concurrent access from the same VM (different classloaders). </li><li>Use JDK 1.4 file locking to create the lock file (but not yet by default); writing a system property to detect concurrent access from the same VM (different classloaders).
</li><li>Support compatibility for jdbc:hsqldb:res: </li><li>Support compatibility for jdbc:hsqldb:res:
</li><li>In the MySQL and PostgreSQL mode, use lower case identifiers by default (DatabaseMetaData.storesLowerCaseIdentifiers = true)
</li><li>Provide a simple, lightweight O/R mapping tool
</li><li>Provide an Java SQL builder with standard and H2 syntax </li><li>Provide an Java SQL builder with standard and H2 syntax
</li><li>Trace: write OS, file system, JVM,... when opening the database </li><li>Trace: write OS, file system, JVM,... when opening the database
</li><li>Support indexes for views (probably requires materialized views) </li><li>Support indexes for views (probably requires materialized views)
...@@ -260,8 +261,6 @@ Of course, patches are always welcome, but are not always applied as is. Patches ...@@ -260,8 +261,6 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>File system that writes to two file systems (replicating file system) </li><li>File system that writes to two file systems (replicating file system)
</li><li>File system with a background writer thread; test if this is faster </li><li>File system with a background writer thread; test if this is faster
</li><li>FTP access to a database (.csv for a table, a directory for a schema, a file for a lob, a script.sql file). </li><li>FTP access to a database (.csv for a table, a directory for a schema, a file for a lob, a script.sql file).
</li><li>LIMIT and OFFSET for GROUP_CONCAT
</li><li>Support triggers for INFORMATION_SCHEMA tables (to better support PostgreSQL catalog: rebuild after creating new tables)
</li><li>Better document the source code </li><li>Better document the source code
</li><li>Support select * from dual a left join dual b on b.x=(select max(x) from dual) </li><li>Support select * from dual a left join dual b on b.x=(select max(x) from dual)
</li><li>Optimization: don't lock when the database is read-only </li><li>Optimization: don't lock when the database is read-only
...@@ -272,7 +271,7 @@ Of course, patches are always welcome, but are not always applied as is. Patches ...@@ -272,7 +271,7 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>Support ENUM data type (see MySQL, PostgreSQL, MS SQL Server, maybe others) </li><li>Support ENUM data type (see MySQL, PostgreSQL, MS SQL Server, maybe others)
</li><li>Command line option for the H2 Console and TCP configuration (which .h2.server.properties and .h2.keystore to use) </li><li>Command line option for the H2 Console and TCP configuration (which .h2.server.properties and .h2.keystore to use)
</li><li>Support a schema name for Java functions </li><li>Support a schema name for Java functions
</li><li>Remember the domain of a column </li><li>Remember the user defined data type (domain) of a column
</li><li>Support Jackcess (MS Access databases) </li><li>Support Jackcess (MS Access databases)
</li><li>Built-in methods to write large objects (BLOB and CLOB): FILE_WRITE('test.txt', 'Hello World') </li><li>Built-in methods to write large objects (BLOB and CLOB): FILE_WRITE('test.txt', 'Hello World')
</li><li>Change package name in version 2.0: org.h2database </li><li>Change package name in version 2.0: org.h2database
...@@ -281,13 +280,10 @@ Of course, patches are always welcome, but are not always applied as is. Patches ...@@ -281,13 +280,10 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>Move Maven 2 repository from hsql.sf.net to h2database.sf.net </li><li>Move Maven 2 repository from hsql.sf.net to h2database.sf.net
</li><li>Java 1.5 tool: JdbcUtils.closeSilently(s1, s2,...) </li><li>Java 1.5 tool: JdbcUtils.closeSilently(s1, s2,...)
</li><li>Javadoc: document design patterns used </li><li>Javadoc: document design patterns used
</li><li>Triggers for metadata tables; use for PostgreSQL catalog
</li><li>Does the FTP server has problems with multithreading? </li><li>Does the FTP server has problems with multithreading?
</li><li>Write an article about SQLInjection (h2\src\docsrc\html\images\SQLInjection.txt) </li><li>Write an article about SQLInjection (h2\src\docsrc\html\images\SQLInjection.txt)
</li><li>Convert SQL-injection-2.txt to html document, include SQLInjection.java sample </li><li>Convert SQL-injection-2.txt to html document, include SQLInjection.java sample
</li><li>Send SQL Injection solution proposal to MySQL, Derby, HSQLDB,...
</li><li>Improve LOB in directories performance </li><li>Improve LOB in directories performance
</li><li>Optimize OR conditions: convert them to IN(...) if possible.
</li><li>Web site design: http://www.igniterealtime.org/projects/openfire/index.jsp </li><li>Web site design: http://www.igniterealtime.org/projects/openfire/index.jsp
</li><li>HSQLDB compatibility: Openfire server uses: CREATE SCHEMA PUBLIC AUTHORIZATION DBA; </li><li>HSQLDB compatibility: Openfire server uses: CREATE SCHEMA PUBLIC AUTHORIZATION DBA;
CREATE USER SA PASSWORD ""; GRANT DBA TO SA; SET SCHEMA PUBLIC CREATE USER SA PASSWORD ""; GRANT DBA TO SA; SET SCHEMA PUBLIC
...@@ -301,7 +297,6 @@ Of course, patches are always welcome, but are not always applied as is. Patches ...@@ -301,7 +297,6 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>Translated .pdf </li><li>Translated .pdf
</li><li>Cluster: hot deploy (adding a node at runtime) </li><li>Cluster: hot deploy (adding a node at runtime)
</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>Try again with Lobo browser (pure Java)
</li><li>Recovery tool: bad blocks should be converted to INSERT INTO SYSTEM_ERRORS(...), and things should go into the .trace.db file </li><li>Recovery tool: bad blocks should be converted to INSERT INTO SYSTEM_ERRORS(...), and things should go into the .trace.db file
</li><li>RECOVER=2 to backup the database, run recovery, open the database </li><li>RECOVER=2 to backup the database, run recovery, open the database
</li><li>Recovery should work with encrypted databases </li><li>Recovery should work with encrypted databases
...@@ -408,6 +403,8 @@ Of course, patches are always welcome, but are not always applied as is. Patches ...@@ -408,6 +403,8 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>OSGi: create a sample application, test, document. </li><li>OSGi: create a sample application, test, document.
</li><li>help.csv: use complete examples for functions; run as test case. </li><li>help.csv: use complete examples for functions; run as test case.
</li><li>Deploy h2..-sources.jar to maven repository. </li><li>Deploy h2..-sources.jar to maven repository.
</li><li>Re-implement PooledConnection; use a lightweight connection object.
</li><li>Doclet: convert some javadocs to a resource (man page for command line tools, tests, build tool).
</li></ul> </li></ul>
<h2>Not Planned</h2> <h2>Not Planned</h2>
......
...@@ -712,25 +712,21 @@ Example permission tags: ...@@ -712,25 +712,21 @@ Example permission tags:
<br /><a name="connection_pool"></a> <br /><a name="connection_pool"></a>
<h2>Using a Connection Pool</h2> <h2>Using a Connection Pool</h2>
<p> <p>
For many databases, opening a connection is slow, and it is a good idea to use a connection pool For H2, opening a connection is fast if the database is already open.
to re-use connections. For H2 however opening a connection usually is fast if the database is already Still, using a connection pool improves performance if you open and close connections a lot.
open. Using a connection pool for H2 actually slows down the process a bit, except if A simple connection pool is included in H2. It is based on the
file encryption is used (in this case opening a connection is about half as fast as using
a connection pool). A simple connection pool is included in H2. It is based on the
<a href="http://www.source-code.biz/snippets/java/8.htm">Mini Connection Pool Manager</a> <a href="http://www.source-code.biz/snippets/java/8.htm">Mini Connection Pool Manager</a>
from Christian d'Heureuse. There are other, more complex connection pools available, for example from Christian d'Heureuse. There are other, more complex connection pools available, for example
<a href="http://jakarta.apache.org/commons/dbcp/">DBCP</a>. The build-in <a href="http://jakarta.apache.org/commons/dbcp/">DBCP</a>.
connection pool is used as follows: For H2, it is about 50 times faster to get a connection from the built-in connection pool than to get
one using DriverManager.getConnection(). The build-in connection pool is used as follows:
</p> </p>
<pre> <pre>
// init // init
import org.h2.jdbcx.*; import org.h2.jdbcx.*;
... ...
JdbcDataSource ds = new JdbcDataSource(); JdbcConnectionPool cp = JdbcConnectionPool.create(
ds.setURL("jdbc:h2:~/test"); "jdbc:h2:~/test", "sa", "sa");
ds.setUser("sa");
ds.setPassword("sa");
JdbcConnectionPool cp = JdbcConnectionPool.create(ds);
// use // use
Connection conn = cp.getConnection(); Connection conn = cp.getConnection();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -282,7 +282,13 @@ java org.h2.test.TestAll timer ...@@ -282,7 +282,13 @@ java org.h2.test.TestAll timer
/* /*
documentation: rolling review at roadmap.html:203 Console, Server, and Shell do not extend Tool yet.
DatabaseH2PoolTest.java
file_lock=serialized and then go back to auto_server=true
throws an exception "method not supported".
documentation: rolling review at roadmap.html:312
create a short 4 pages documentation create a short 4 pages documentation
...@@ -347,6 +353,10 @@ VARCHAR= ?)) p ON color.c = p.c WHERE p.c IS NULL; ...@@ -347,6 +353,10 @@ VARCHAR= ?)) p ON color.c = p.c WHERE p.c IS NULL;
http://www.w3schools.com/sql/ http://www.w3schools.com/sql/
kill a specific java process:
kill -9 `jps -l | grep "org.h2.test.TestAll" | cut -d " " -f 1`
*/ */
if (args.length > 0) { if (args.length > 0) {
if ("crash".equals(args[0])) { if ("crash".equals(args[0])) {
......
...@@ -583,4 +583,4 @@ opengeospatial sfs symmetric obsolete failing parenthesis unloading refreshed ...@@ -583,4 +583,4 @@ opengeospatial sfs symmetric obsolete failing parenthesis unloading refreshed
grails reloading slightly accepting deploying conflicting recovered counters grails reloading slightly accepting deploying conflicting recovered counters
versus extracts squirrel misdirected rle looking arc addressed european versus extracts squirrel misdirected rle looking arc addressed european
soerensen favicon glass restarts flexive fish resulted vpda mvc kotek jan soerensen favicon glass restarts flexive fish resulted vpda mvc kotek jan
consistently springfuse consistently springfuse grep signatures
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论