提交 9f66c993 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 7667ff29
......@@ -19,14 +19,14 @@ Change Log
<h2>Next Version (unreleased)</h2>
<ul><li>Linked tables that point to the same database can now share the connection
within the same database. Access to the same connection is serialized. To enable this feature,
set the system property h2.shareLinkedConnections to true.
within the same database. Access to the same connection is serialized. To enable this feature,
set the system property h2.shareLinkedConnections to true.
</li><li>Multiple processes can now access the same database without having to explicitly
start the server. To do that, append ;AUTO_SERVER=TRUE to the database URL.
In this case, the server is started automatically if the connection is in embedded mode,
and the server mode is used if a server is running. If the process that opened the first
connection is closed, the other client need to reconnect (there is no automatic re-connect so far).
Remote connections are allowed, but only to this database.
start the server. To do that, append ;AUTO_SERVER=TRUE to the database URL.
In this case, the server is started automatically if the connection is in embedded mode,
and the server mode is used if a server is running. If the process that opened the first
connection is closed, the other client need to reconnect (there is no automatic re-connect so far).
Remote connections are allowed, but only to this database.
</li><li>The server tool now displays the correct IP address if networked.
</li><li>Can now start a TCP server with port 0 (automatically select a port).
</li><li>Result sets with just a unique index can now be updated (previously a primary key was required).
......
......@@ -109,6 +109,11 @@ Tool to copy data from one database to another.
<h2>Products and Projects</h2>
<p><a href="http://aejaks.sf.net">
&AElig;jaks</a><br />
A server-side scripting environment to build AJAX enabled web applications.
</p>
<p><a href="http://www.axiomstack.com/">
Axiom Stack</a><br />
A web framework that let's you write dynamic web applications with Zen-like simplicity.
......
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.
......@@ -79,6 +79,7 @@ public class SysProperties {
* <p>
* This feature is disabled by default for compatibility with other
* databases (HSQLDB, Apache Derby, PostgreSQL, some version of MySQL).
* </p>
*/
public static final boolean ALIAS_COLUMN_NAME = getBooleanSetting("h2.aliasColumnName", false);
......@@ -229,8 +230,9 @@ public class SysProperties {
* Store LOB files in subdirectories.
* <p>
* In version 1.0, it is disabled by default.
* <p>
* </p><p>
* In version 1.1, it is enabled by default.
* </p>
*/
// TODO: when removing this property, also remove
// DataHandler.allocateObjectId, createTempFile it
......@@ -320,8 +322,9 @@ public class SysProperties {
* Support old command line options.
* <p>
* In version 1.0, it is enabled by default.
* <p>
* </p><p>
* In version 1.1, it is disabled by default.
* </p>
*/
public static final boolean OLD_COMMAND_LINE_OPTIONS = getBooleanSetting("h2.oldCommandLineOptions", Constants.VERSION < 1.1);
......@@ -360,8 +363,9 @@ public class SysProperties {
* by columns.
* <p>
* In version 1.0, it is disabled by default.
* <p>
* </p><p>
* In version 1.1, it is enabled by default.
* </p>
*/
public static final boolean OPTIMIZE_GROUP_SORTED = getBooleanSetting("h2.optimizeGroupSorted", Constants.VERSION > 1.0);
......@@ -376,8 +380,9 @@ public class SysProperties {
* Optimize IN(...) comparisons by converting them to inner joins.
* <p>
* In version 1.0, it is disabled by default.
* <p>
* </p><p>
* In version 1.1, it is enabled by default.
* </p>
*/
public static boolean optimizeInJoin = getBooleanSetting("h2.optimizeInJoin", Constants.VERSION > 1.0);
......@@ -465,7 +470,8 @@ public class SysProperties {
public static final int SERVER_CACHED_OBJECTS = getIntSetting("h2.serverCachedObjects", 64);
/**
* System property <code>h2.serverResultSetFetchSize</code> (default: 100).<br />
* System property <code>h2.serverResultSetFetchSize</code>
* (default: 100).<br />
* The default result set fetch size when using the server mode.
*/
public static final int SERVER_RESULT_SET_FETCH_SIZE = getIntSetting("h2.serverResultSetFetchSize", 100);
......@@ -473,11 +479,14 @@ public class SysProperties {
/**
* System property <code>h2.shareLinkedConnections</code>.<br />
* Linked connections should be shared, that means connections to the same
* database should be used for all linked tables that connect to the same database.
* database should be used for all linked tables that connect to the same
* database.
* <p>
* In version 1.0, it is disabled by default.
* </p>
* <p>
* In version 1.1, it is enabled by default.
* </p>
*/
public static final boolean SHARE_LINKED_CONNECTIONS = getBooleanSetting("h2.shareLinkedConnections", Constants.VERSION > 1.0);
......
......@@ -106,7 +106,7 @@ public class JdbcConnection extends TraceObject implements Connection {
ci.setBaseDir(baseDir);
}
}
boolean autoServerMode = Boolean.parseBoolean(ci.getProperty("AUTO_SERVER", "false"));
boolean autoServerMode = Boolean.valueOf(ci.getProperty("AUTO_SERVER", "false")).booleanValue();
ConnectionInfo backup = null;
if (autoServerMode) {
backup = (ConnectionInfo) ci.clone();
......
......@@ -41,6 +41,25 @@ public class TableLinkConnection {
*/
private int useCounter;
private TableLinkConnection(HashMap map, String driver, String url, String user, String password) {
this.map = map;
this.driver = driver;
this.url = url;
this.user = user;
this.password = password;
}
/**
* Open a new connection.
*
* @param map the map where the connection should be stored
* (if shared connections are enabled).
* @param driver the JDBC driver class name
* @param url the database URL
* @param user the user name
* @param password the password
* @return a connection
*/
public static TableLinkConnection open(HashMap map, String driver, String url, String user, String password) throws SQLException {
TableLinkConnection t = new TableLinkConnection(map, driver, url, user, password);
if (SysProperties.SHARE_LINKED_CONNECTIONS) {
......@@ -66,14 +85,6 @@ public class TableLinkConnection {
}
}
private TableLinkConnection(HashMap map, String driver, String url, String user, String password) {
this.map = map;
this.driver = driver;
this.url = url;
this.user = user;
this.password = password;
}
private void open() throws SQLException {
conn = JdbcUtils.getConnection(driver, url, user, password);
}
......
......@@ -198,7 +198,7 @@ public class ObjectUtils {
/**
* Calculate the hash code of the given object. The object may be null.
*
* @param the object
* @param o the object
* @return the hash code, or 0 if the object is null
*/
public static int hashCode(Object o) {
......
......@@ -739,6 +739,12 @@ public class ValueLob extends Value {
}
}
/**
* Check if a lob file exists for this database.
*
* @param prefix the file name prefix
* @return true if a lob file exists
*/
public static boolean existsLobFile(String prefix) throws SQLException {
String dir = FileUtils.getParent(prefix);
String[] list = FileUtils.listFiles(dir);
......
......@@ -278,7 +278,8 @@ java org.h2.test.TestAll timer
14.zip
check all version(s) before the release
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
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
test on linux
......
......@@ -41,6 +41,9 @@ public abstract class TestBase {
*/
protected TestAll config;
/**
* The time when the test was started.
*/
protected long start;
/**
......@@ -136,10 +139,23 @@ public abstract class TestBase {
return getConnectionInternal(getURL(name, false), user, password);
}
/**
* Get the password to use to login for the given user password. The file
* password is added if required.
*
* @param userPassword the password of this user
* @return the login password
*/
protected String getPassword(String userPassword) {
return config == null || config.cipher == null ? userPassword : "filePassword " + userPassword;
}
/**
* Get the login password. This is usually the user password. If file
* encryption is used it is combined with the file password.
*
* @return the login password
*/
protected String getPassword() {
return getPassword("123");
}
......
......@@ -51,7 +51,6 @@ public class TestScript extends TestBase {
* Get all SQL statements of this file.
*
* @param conf the configuration
* @param file the file name
* @return the list of statements
*/
public ArrayList getAllStatements(TestAll conf) throws Exception {
......
......@@ -19,6 +19,9 @@ import org.h2.util.SortedProperties;
*/
public class TestAutoServer extends TestBase {
/**
* If enabled, this flag allows to debug the test case.
*/
static final boolean SLOW = false;
/**
......@@ -74,6 +77,9 @@ public class TestAutoServer extends TestBase {
// proc.destroy();
}
/**
* This method is called via reflection from the database.
*/
public static void halt(int exitValue) {
Runtime.getRuntime().halt(exitValue);
}
......
......@@ -17,6 +17,12 @@ import org.h2.test.TestBase;
* Tests automatic embedded/server mode.
*/
public class TestAutoServer2 extends TestBase {
/**
* Run just this test.
*
* @param a the connection information or empty
*/
public static void main(String[] a) throws Exception {
if (a.length == 3) {
// PrintStream ps = new PrintStream(new File("test.txt"));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论