提交 6bac2d95 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 53cb0b94
......@@ -18,19 +18,27 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>Local temporary tables now support indexes. Thanks a lot to Matt Roy!
<ul><li>OSGi meta data is included in the manifest file.
An OSGi BundleActivator is included: it loads the database driver when starting the bundle,
and unloads it when stopping the bundle.
</li><li>The default value for MAX_MEMORY_UNDO to 50000.
</li><li>For alias columns, ResultSetMetaData.getTableName() and getColumnName() now
return the real table and column name in the default mode.
</li><li>In SQL scripts created with SCRIPT TO, schemas are now only created if they don't exist yet.
</li><li>After re-connecting to a database, the database event listener (if set) is informed about it.
</li><li>Local temporary tables now support indexes. Thanks a lot to Matt Roy!
</li><li>RUNSCRIPT no longer uses a temporary file.
</li><li>New system table INFORMATION_SCHEMA.SESSION_STATE containing the
SQL statements that make up the session state. The list currently contains
variables (SET @..) and local temporary tables (without data).
SQL statements that make up the session state. The list currently contains
variables (SET @..) and local temporary tables (without data).
</li><li>After an automatic re-connect, part of the session state stays (the part
that is stored in the SESSION_STATE table).
that is stored in the SESSION_STATE table).
</li><li>The build didn't work if the directory temp didn't exist before.
</li><li>New system property h2.maxReconnect (default 3) to limit the number of re-connects
for the same SQL statement (this is usually only important for SHUTDOWN).
for the same SQL statement (this is usually only important for SHUTDOWN).
</li><li>WHERE .. IN (SELECT ...) could throw a NullPointerException.
</li><li>Improved Glassfish / Toplink support in H2Platform
thanks to Marcio Borges from Brazil. Thanks a lot!
thanks to Marcio Borges from Brazil. Thanks a lot!
</li></ul>
<h2>Version 1.1.100 (2008-10-04)</h2>
......
......@@ -1016,6 +1016,8 @@ or the SQL statement <code>SET MODE PostgreSQL</code>.
</li><li>When converting a floating point number to a integer, the fractional
digits should not be truncated, but the value should be rounded.
</li><li>The system columns 'CTID' and 'OID' should be supported.
</li><li>For aliased columns, ResultSetMetaData.getColumnName() returns the alias name
and getTableName() returns null.
</li></ul>
<h3>MySQL Compatibility Mode</h3>
......@@ -1027,9 +1029,11 @@ or the SQL statement <code>SET MODE MySQL</code>.
then a 0 (or empty string, or the current timestamp for timestamp columns) value is used.
Usually, this operation is not allowed and an exception is thrown.
</li><li>When converting a floating point number to a integer, the fractional
digits should not be truncated, but the value should be rounded.
digits should not be truncated, but the value should be rounded.
</li><li>The identifiers should be returned in lower case.
</li><li>Creating indexes in the CREATE TABLE statement should be supported.
</li><li>For aliased columns, ResultSetMetaData.getColumnName() and getTableName()
return the real column and table name.
</li></ul>
<h3>HSQLDB Compatibility Mode</h3>
......@@ -1038,12 +1042,14 @@ To use the HSQLDB mode, use the database URL <code>jdbc:h2:~/test;MODE=HSQLDB</c
or the SQL statement <code>SET MODE HSQLDB</code>.
</p>
<ul><li>Concatenation of a NULL with another value results in NULL. Usually, the NULL is treated as an empty
string if only one of the operators is NULL, and NULL is only returned if both values are NULL.
string if only one of the operators is NULL, and NULL is only returned if both values are NULL.
</li><li>When converting the scale of decimal data, the number is only converted if the new scale is
smaller then current scale. Usually, the scale is converted and 0s are added if required.
smaller then current scale. Usually, the scale is converted and 0s are added if required.
</li><li>When using unique indexes, multiple rows with NULL in one of the columns
are allowed by default. However many databases view NULL as distinct in
this regard and only allow one row with NULL.
this regard and only allow one row with NULL.
</li><li>For aliased columns, ResultSetMetaData.getColumnName() returns the alias name
and getTableName() returns null.
</li></ul>
<h3>MS SQL Server Compatibility Mode</h3>
......@@ -1054,7 +1060,9 @@ or the SQL statement <code>SET MODE MSSQLServer</code>.
<ul><li>Identifiers may be quoted using square brackets as in [Test].
</li><li>When using unique indexes, multiple rows with NULL in one of the columns
are allowed by default. However many databases view NULL as distinct in
this regard and only allow one row with NULL.
this regard and only allow one row with NULL.
</li><li>For aliased columns, ResultSetMetaData.getColumnName() returns the alias name
and getTableName() returns null.
</li></ul>
<h3>Derby Compatibility Mode</h3>
......@@ -1064,7 +1072,9 @@ or the SQL statement <code>SET MODE Derby</code>.
</p>
<ul><li>When using unique indexes, multiple rows with NULL in one of the columns
are allowed by default. However many databases view NULL as distinct in
this regard and only allow one row with NULL.
this regard and only allow one row with NULL.
</li><li>For aliased columns, ResultSetMetaData.getColumnName() returns the alias name
and getTableName() returns null.
</li></ul>
<h3>Oracle Compatibility Mode</h3>
......@@ -1074,7 +1084,9 @@ or the SQL statement <code>SET MODE Oracle</code>.
</p>
<ul><li>When using unique indexes, multiple rows with NULL in one of the columns
are allowed by default. However many databases view NULL as distinct in
this regard and only allow one row with NULL.
this regard and only allow one row with NULL.
</li><li>For aliased columns, ResultSetMetaData.getColumnName() returns the alias name
and getTableName() returns null.
</li></ul>
<br /><a name="trace_options"></a>
......
......@@ -164,6 +164,11 @@ CrashPlan PRO Server</a><br />
Easy and cross platform backup solution for business and service providers.
</p>
<p><a href="http://dbunit.wikidot.com/">
DbUnit</a><br />
A JUnit extension (also usable with Ant) targeted for database-driven projects.
</p>
<p><a href="http://antilogics.com/epictetus.html">
Epictetus</a><br />
Free cross platform database tool.
......@@ -246,6 +251,12 @@ JGeocoder</a><br />
Free Java geocoder. Geocoding is the process of estimating a latitude and longitude for a given location.
</p>
<p><a href="http://www.jgrass.org/">
JGrass</a><br />
Java Geographic Resources Analysis Support System.
Free, multi platform, open source GIS based on the GIS framework of uDig.
</p>
<p><a href="http://jena.sourceforge.net/">
Jena</a><br />
Java framework for building Semantic Web applications.
......@@ -336,10 +347,15 @@ OWL, RDF, RDFS, SPARQL, and F-Logic.
</p>
<p><a href="http://www.openanzo.org">
Open Anzo </a><br />
Open Anzo</a><br />
Semantic Application Server.
</p>
<p><a href="http://www.opengroove.org">
OpenGroove</a><br />
OpenGroove is a groupware program that allows users to synchronize data.
</p>
<p><a href="http://www.orionserver.com/">
Orion</a><br />
J2EE Application Server.
......@@ -421,6 +437,11 @@ Signsoft intelliBO</a><br />
Persistence middleware supporting the JDO specification.
</p>
<p><a href="http://www.simpleorm.org">
SimpleORM</a><br />
Simple Java Object Relational Mapping.
</p>
<p><a href="http://www.smartfoxserver.com/">
SmartFoxServer</a><br />
Platform for developing multiuser applications and games with Macromedia Flash.
......
......@@ -21,32 +21,25 @@ New (feature) requests will usually be added at the very end of the list. The pr
Of course, patches are always welcome, but are not always applied as is. Patches should include test cases and documentation.
</p>
<h2>In Version 1.1</h2>
<ul>
<li>Change Constants.DEFAULT_MAX_MEMORY_UNDO to 10000 (and change the docs). Test.
</li><li>Change the default for NULL || 'x' to NULL
</li></ul>
<h2>Priority 1</h2>
<ul>
<li>Bugfixes
</li><li>Write more tests and documentation for MVCC (Multi Version Concurrency Control)
</li><li>RECOVER=1 should automatically recover, =2 should run the recovery tool if required
</li><li>More tests with MULTI_THREADED=1
</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>Optimization: result set caching (like MySQL)
</li><li>Server side cursors
</li><li>Migrate database tool (also from other database engines)
</li><li>Shutdown compact
</li></ul>
<h2>Priority 2</h2>
<ul>
<li>Improve test code coverage
</li><li>Support OSGi: http://oscar-osgi.sourceforge.net, http://incubator.apache.org/felix/index.html
</li><li>Test multi-threaded in-memory db access
</li><li>Procedural language / script language (Javascript)
</li><li>Option to shutdown all the running servers (on the same VM).
</li><li>Support OSGi: http://oscar-osgi.sourceforge.net, http://incubator.apache.org/felix/index.html
</li><li>Optimize ID=? OR ID=?: convert to IN(...)
</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)
......@@ -64,6 +57,7 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>Groovy Stored Procedures (http://groovy.codehaus.org/Groovy+SQL)
</li><li>System table / function: cache usage
</li><li>Add a migration guide (list differences between databases)
</li><li>Migrate database tool (also from other database engines)
</li><li>Optimization: automatic index creation suggestion using the trace file?
</li><li>Compression performance: don't allocate buffers, compress / expand in to out buffer
</li><li>Sequence: add features [NO] MINVALUE, MAXVALUE, CYCLE
......@@ -383,6 +377,8 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>Open a read-only database but don't share it with other connections. jdbc:h2:~/test;PRIVATE=TRUE
</li><li>Index creation only using deterministic functions.
</li><li>Use http://recaptcha.net somehow to secure the Google Group.
</li><li>Support DELETE with TOP or LIMIT. See also: http://dev.mysql.com/doc/refman/5.1/de/delete.html
</li><li>Change the default for NULL || 'x' to return NULL
</li></ul>
<h2>Not Planned</h2>
......
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.
......@@ -10,6 +10,7 @@ import java.io.IOException;
import java.net.Socket;
import java.sql.SQLException;
import org.h2.api.DatabaseEventListener;
import org.h2.command.CommandInterface;
import org.h2.command.CommandRemote;
import org.h2.command.dml.SetTypes;
......@@ -36,8 +37,8 @@ import org.h2.value.Value;
import org.h2.value.ValueString;
/**
* The client side part of a session when using the server mode.
* This object communicates with a Session on the server side.
* The client side part of a session when using the server mode. This object
* communicates with a Session on the server side.
*/
public class SessionRemote implements SessionInterface, DataHandler {
......@@ -81,11 +82,12 @@ public class SessionRemote implements SessionInterface, DataHandler {
private boolean sessionStateChanged;
private ObjectArray sessionState;
private boolean sessionStateUpdating;
private DatabaseEventListener eventListener;
public SessionRemote() {
// nothing to do
}
private SessionRemote(ConnectionInfo ci) throws SQLException {
this.connectionInfo = ci;
}
......@@ -123,7 +125,7 @@ public class SessionRemote implements SessionInterface, DataHandler {
autoCommit = true;
return trans;
}
public void cancel() {
// this method is called when closing the connection
// the statement that is currently running is not canceled in this case
......@@ -224,14 +226,14 @@ public class SessionRemote implements SessionInterface, DataHandler {
public SessionInterface createSession(ConnectionInfo ci) throws SQLException {
return new SessionRemote(ci).connectEmbeddedOrServer();
}
private SessionInterface connectEmbeddedOrServer() throws SQLException {
ConnectionInfo ci = connectionInfo;
if (ci.isRemote()) {
connectServer(ci);
return this;
}
// create the session using reflection,
// create the session using reflection,
// so that the JDBC layer can be compiled without it
boolean autoServerMode = Boolean.valueOf(ci.getProperty("AUTO_SERVER", "false")).booleanValue();
ConnectionInfo backup = null;
......@@ -249,8 +251,8 @@ public class SessionRemote implements SessionInterface, DataHandler {
String serverKey = (String) ((JdbcSQLException) e).getPayload();
if (serverKey != null) {
backup.setServerKey(serverKey);
// OPEN_NEW must be removed now, otherwise
// opening a session with AUTO_SERVER fails
// OPEN_NEW must be removed now, otherwise
// opening a session with AUTO_SERVER fails
// if another connection is already open
backup.removeProperty("OPEN_NEW", false);
connectServer(backup);
......@@ -263,7 +265,7 @@ public class SessionRemote implements SessionInterface, DataHandler {
throw Message.convert(e);
}
}
private void connectServer(ConnectionInfo ci) throws SQLException {
String name = ci.getName();
if (name.startsWith("//")) {
......@@ -305,6 +307,20 @@ public class SessionRemote implements SessionInterface, DataHandler {
if (autoReconnect && serverList != null) {
throw Message.getSQLException(ErrorCode.FEATURE_NOT_SUPPORTED);
}
if (autoReconnect) {
eventListener = ci.getDatabaseEventListenerObject();
if (eventListener == null) {
String className = ci.getProperty("DATABASE_EVENT_LISTENER");
if (className != null) {
className = StringUtils.trim(className, true, true, "'");
try {
eventListener = (DatabaseEventListener) ClassUtils.loadUserClass(className).newInstance();
} catch (Throwable e) {
throw Message.convert(e);
}
}
}
}
cipher = ci.getProperty("CIPHER");
if (cipher != null) {
fileEncryptionKey = RandomUtils.getSecureBytes(32);
......@@ -334,10 +350,10 @@ public class SessionRemote implements SessionInterface, DataHandler {
}
upgradeClientVersionIfPossible();
}
private void upgradeClientVersionIfPossible() {
try {
// TODO check if a newer client version can be used
// TODO check if a newer client version can be used
// not required when sending TCP_DRIVER_VERSION_6
CommandInterface command = prepareCommand("SELECT VALUE FROM INFORMATION_SCHEMA.SETTINGS WHERE NAME=?", 1);
ParameterInterface param = (ParameterInterface) command.getParameters().get(0);
......@@ -370,7 +386,7 @@ public class SessionRemote implements SessionInterface, DataHandler {
}
}
}
}
}
......@@ -390,7 +406,7 @@ public class SessionRemote implements SessionInterface, DataHandler {
transferList.remove(i);
if (autoReconnect(count)) {
return;
}
}
checkClosed();
switchOffCluster();
}
......@@ -401,7 +417,7 @@ public class SessionRemote implements SessionInterface, DataHandler {
return new CommandRemote(this, transferList, sql, fetchSize);
}
}
/**
* Automatically re-connect if necessary and if configured to do so.
*
......@@ -423,7 +439,7 @@ public class SessionRemote implements SessionInterface, DataHandler {
// connected to a server somewhere else
embedded = null;
} else {
// opened an embedded connection now -
// opened an embedded connection now -
// must connect to this database in server mode
// unfortunately
connectEmbeddedOrServer();
......@@ -441,6 +457,10 @@ public class SessionRemote implements SessionInterface, DataHandler {
sessionStateChanged = false;
}
}
if (eventListener != null) {
eventListener.setProgress(DatabaseEventListener.STATE_RECONNECTED, databaseName, count,
SysProperties.MAX_RECONNECT);
}
return true;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论