H2 Logo
English Japanese
検索:

Highlight keyword(s)
ホーム
クイックスタート
インストール
チュートリアル
特徴
パフォーマンス
進歩したトピックス
JaQu
ダウンロード

参照
SQL文法
関数
データ型
Javadoc
Docs as PDF (1 MB)
Error Analyzer

付録
ビルド
歴史とロードマップ
Links
FAQ
ライセンス

 

F A Q

Are there Known Bugs? When is the Next Release?
このデータベースエンジンはオープンソースですか?
My Query is Slow
新規データベースの構築方法は?
データベースへの接続方法は?
データベースのファイルはどこに保存されますか?
What is the Size Limit (Maximum Size) of a Database?
これは信頼できるデータベースですか?
Why is Opening my Database Slow?
Is the GCJ Version Stable? Faster?
このプロジェクトの翻訳方法は?

Are there Known Bugs? When is the Next Release?

Usually, bugs get fixes as they are found. There is a release every few weeks. Here is the list of known and confirmed issues:

  • Tomcat and Glassfish 3 set most static fields (final or non-final) to null when unloading a web application. This can cause a NullPointerException in H2 versions 1.1.107 and older, and may still not work in newer versions. Please report it if you run into this issue. In Tomcat >= 6.0 this behavior can be disabled by setting the system property org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES to false, however Tomcat may then run out of memory. A known workaround is to put the h2.jar file in a shared lib directory (common/lib).
  • Some problems have been found with right outer join. Internally, it is converted to left outer join, which does not always produce the same results as other databases when used in combination with other joins.
  • When using Install4j before 4.1.4 on Linux and enabling 'pack200', the h2*.jar becomes corrupted by the install process, causing application failure. A workaround is to add an empty file h2*.jar.nopack next to the h2*.jar file. This problem is solved in Install4j 4.1.4.

このデータベースエンジンはオープンソースですか?

はい、H2DBはフリーウェアであり、再配布も可能です。ソースコードも含まれています。ライセンスページも合わせてご確認ください。


My Query is Slow

SELECT (または DELETE、UPDATE、MERGE) ステートメント実行に時間がかかるのはいくつかの理由が考えられます。以下のチェックリストをご確認ください:

  • Run ANALYZE (see documentation for details).
  • クエリにEXPLAINオプションを付けて実行し、インデックスが利用されているかどうか確認する (詳細はドキュメントをご覧下さい)
  • 必要に応じてインデックスを追加し、ANALYZE、EXPLAINオプションを用いて再度クエリを実行する
  • それでも解決しない場合は、ご連絡ください

新規データベースの構築方法は?

データベースがまだ存在しない場合、デフォルト設定では自動的に新規作成されます


データベースへの接続方法は?

データベースドライバは org.h2.Driver で、データベースURLは jdbc:h2: で始まります。JDBCを利用してデータベースに接続する場合は、以下のコードを利用して下さい:

Class.forName("org.h2.Driver");
Connection conn = DriverManager.getConnection("jdbc:h2:~/test", "sa", "");

データベースのファイルはどこに保存されますか?

When using database URLs like jdbc:h2:~/test, the database is stored in the user directory. For Windows, this is usually "C:\Documents and Settings\<userName>". If the base directory is not set (as in jdbc:h2:test), the database files are stored in the directory where the application is started (the current working directory). When using the H2 Console application from the start menu, this is "<Installation Directory>/bin". The base directory can be set in the database URL. A fixed or relative path can be used. When using the URL jdbc:h2:file:data/sample, the database is stored in the directory "data" (relative to the current working directory). The directory is created automatically if it does not yet exist. It is also possible to use the fully qualified directory name (and for Windows, drive name). Example: jdbc:h2:file:C:/data/test


What is the Size Limit (Maximum Size) of a Database?

See Limits and Limitations .


これは信頼できるデータベースですか?

Some users have reported that after a power failure, the database can sometimes not be opened because the index file is corrupt. In that case, the index file can be deleted (it is automatically re-created). To avoid this, append ;LOG=2 to the database URL. See also: SET LOG . This problem will be solved using the new 'page store' mechanism (currently experimental).

That is not easy to say. It is still a quite new product. A lot of tests have been written, and the code coverage of these tests is very high. Randomized stress tests are run regularly. But there are probably still bugs that have not yet been found (as with most software). Some features are known to be dangerous, they are only supported for situations where performance is more important than reliability. Those dangerous features are:

  • Disabling the transaction log mechanism using SET LOG 0.
  • Using the transaction isolation level READ_UNCOMMITTED (LOCK_MODE 0) while at the same time using multiple connections.
  • Disabling database file protection using FILE_LOCK=NO in the database URL.
  • Disabling referential integrity using SET REFERENTIAL_INTEGRITY FALSE.

In addition to that, running out of memory should be avoided. In older versions, OutOfMemory errors while using the database could corrupt a databases.

Areas that are not fully tested:

  • Platforms other than Windows XP, Linux, Mac OS X, or JVMs other than Sun 1.5 or 1.6
  • The features AUTO_SERVER and AUTO_RECONNECT
  • The MVCC (multi version concurrency) mode
  • Cluster mode, 2-phase commit, savepoints
  • 24/7 operation
  • Some operations on databases larger than 500 MB may be slower than expected
  • The optimizer may not always select the best plan
  • Fulltext search
  • Operations on LOBs over 2 GB

試験的に考慮された箇所は以下の通り:

  • The PostgreSQL server
  • The new page store
  • Multi-threading within the engine using SET MULTI_THREADED=1
  • 他のデータベースとの互換モード (一部の特徴のみ提供される)

Why is Opening my Database Slow?

If it takes a long time to open a database, in most cases it was not closed the last time. This is specially a problem for larger databases. To close a database, close all connections to it before the application ends, or execute the command SHUTDOWN. The database is also closed when the virtual machine exits normally by using a shutdown hook. However killing a Java process or calling Runtime.halt will prevent this. The reason why opening is slow in this situations is that indexes are re-created. If you can not guarantee the database is closed, consider using SET LOG 2 (see SQL Grammar).

To find out what the problem is, open the database in embedded mode using the H2 Console. This will print progress information. If you have many 'Creating index' lines it is an indication that the database was not closed the last time.

Other possible reasons are: the database is very big (many GB), or contains linked tables that are slow to open.


Is the GCJ Version Stable? Faster?

GCJバージョンは、Javaバージョンほどは安定していません。GCJバージョンでリグレッションテストを実行した時、アプリケーションはランダムポイントと思われるところで、エラーメッセージなしで停止する場合があります。現在、GCJバージョンはSun VMの使用時よりも低速です。しかし、GCJバージョンの起動はVM使用時よりも高速です。


このプロジェクトの翻訳方法は?

For more information, see Build/Translating .