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

--no commit message

--no commit message
上级 e9852b45
......@@ -38,19 +38,19 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
<h3>Version 1.0 / TODO (Build TODO)</h3><ul>
<li>If SHUTDOWN IMMEDIATELY was called, then the connection was not closed and the database
opened from somebody else at the same time, in some cases this could result in errors with LOB files. Fixed.
opened from somebody else at the same time, in some cases this could result in errors with LOB files. Fixed.
</li><li>The new view implementation is now enabled by default.
To use the old implementation, set the system property 'h2.indexOld' to true
(java -Dh2.indexOld=true ..., or in source code Constants.INDEX_OLD = true).
To use the old implementation, set the system property 'h2.indexOld' to true
(java -Dh2.indexOld=true ..., or in source code Constants.INDEX_OLD = true).
If no problems are found, the old implementation will be removed in the next release.
The old implementation does not work with multi-level nested temporary views
(select * from (select * from (select * from test))).
</li><li>The new view implementation did not work with &lt; and &lt;= comparison. Fixed.
</li><li>Both view implementations did not work with multiple levels of nested temporary views (FROM (SELECT...)). Fixed.
</li><li>The H2 Console can now be run as a standalone web application,
or it can be embedded as a servlet into any existing web application. To build the
'H2 Console' web application, execute 'ant warConsole'.
See src/tools/org/h2/server/web and src/tools/WEB-INF for details.
or it can be embedded as a servlet into any existing web application. To build the
'H2 Console' web application, execute 'ant warConsole'.
See src/tools/org/h2/server/web and src/tools/WEB-INF for details.
</li><li>Deleting database files didn't work for Windows if the database was on the root directory of a drive.
</li><li>The Polish translation is available. Thanks a lot to Tomek!
</li><li>Windows service: the CLASSPATH was not included when starting the service. Fixed.
......@@ -1096,6 +1096,7 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
</li><li>Support multiple directories (on different hard drives) for the same database
</li><li>Server protocol: use challenge response authentication, but client sends hash(user+password) encrypted with response
</li><li>Support EXEC[UTE] (doesn't return a result set, compatible to MS SQL Server)
</li><li>GROUP BY and DISTINCT: support large groups (buffer to disk), do not keep large sets in memory
</li></ul>
<h3>Not Planned</h3>
......
h2/src/docsrc/html/images/download.png

806 Bytes | W: | H:

h2/src/docsrc/html/images/download.png

745 Bytes | W: | H:

h2/src/docsrc/html/images/download.png
h2/src/docsrc/html/images/download.png
h2/src/docsrc/html/images/download.png
h2/src/docsrc/html/images/download.png
  • 2-up
  • Swipe
  • Onion skin
h2/src/docsrc/html/images/mail-support.png

768 Bytes | W: | H:

h2/src/docsrc/html/images/mail-support.png

756 Bytes | W: | H:

h2/src/docsrc/html/images/mail-support.png
h2/src/docsrc/html/images/mail-support.png
h2/src/docsrc/html/images/mail-support.png
h2/src/docsrc/html/images/mail-support.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -181,13 +181,6 @@ public class CommandRemote implements CommandInterface {
}
}
// public void finalize() {
// if(!Constants.RUN_FINALIZE) {
// return;
// }
// close();
// }
public void cancel() {
// TODO server: support cancel
}
......
......@@ -283,11 +283,11 @@ public class ConstraintReferential extends Constraint {
Cursor cursor = index.find(session, check, check);
while(cursor.next()) {
SearchRow found;
if(Constants.INDEX_LOOKUP_NEW) {
found = cursor.getSearchRow();
} else {
found = cursor.get();
}
if(Constants.INDEX_LOOKUP_NEW) {
found = cursor.getSearchRow();
} else {
found = cursor.get();
}
Column[] cols = index.getColumns();
boolean allEqual = true;
for(int i=0; i<columns.length && i<cols.length; i++) {
......
......@@ -41,8 +41,8 @@ public class ConnectionInfo {
}
// TODO document these settings
String[] connectionTime = new String[]{
"ACCESS_MODE_LOG", "ACCESS_MODE_DATA", "AUTOCOMMIT",
"CIPHER", "CREATE", "CACHE_TYPE",
"ACCESS_MODE_LOG", "ACCESS_MODE_DATA", "AUTOCOMMIT",
"CIPHER", "CREATE", "CACHE_TYPE",
"DB_CLOSE_ON_EXIT", "FILE_LOCK", "IGNORE_UNKNOWN_SETTINGS", "IFEXISTS",
"PASSWORD", "RECOVER", "STORAGE", "USER"
};
......
......@@ -67,8 +67,8 @@ package org.h2.engine;
*/
public class Constants {
public static final int BUILD_ID = 50;
private static final String BUILD = "2007-06-17";
public static final int BUILD_ID = 51;
private static final String BUILD = "2007-06-25";
public static final int VERSION_MAJOR = 1;
public static final int VERSION_MINOR = 0;
......@@ -246,7 +246,8 @@ public class Constants {
public static int MAX_FILE_RETRY = Math.max(1, getIntSetting("h2.maxFileRetry", 16));
public static boolean LOB_CLOSE_BETWEEN_READS = getBooleanSetting("h2.lobCloseBetweenReads", false);
public static boolean INDEX_OLD = getBooleanSetting("h2.indexOld", false);
public static final boolean INDEX_LOOKUP_NEW = getBooleanSetting("h2.indexLookupNew", true);
public static final boolean INDEX_LOOKUP_NEW = getBooleanSetting("h2.indexLookupNew", true);
public static final boolean TRACE_IO = getBooleanSetting("h2.traceIO", false);
public static boolean getBooleanSetting(String name, boolean defaultValue) {
String s = System.getProperty(name);
......
......@@ -838,20 +838,20 @@ public class Database implements DataHandler {
log = null;
}
closeFiles();
if (persistent && lock == null && fileLockMethod != FileLock.LOCK_NO) {
// everything already closed (maybe in checkPowerOff)
// don't delete temp files in this case because
// the database could be open now (even from within another process)
return;
}
if (persistent && lock == null && fileLockMethod != FileLock.LOCK_NO) {
// everything already closed (maybe in checkPowerOff)
// don't delete temp files in this case because
// the database could be open now (even from within another process)
return;
}
deleteOldTempFiles();
if(systemSession != null) {
systemSession.close();
systemSession = null;
}
if(lock != null) {
lock.unlock();
lock = null;
lock.unlock();
lock = null;
}
}
......
......@@ -469,7 +469,7 @@ public class Session implements SessionInterface {
}
public String getNextTempViewName() {
return "TEMP_VIEW_" + tempViewIndex++;
return "TEMP_VIEW_" + tempViewIndex++;
}
}
......@@ -683,9 +683,9 @@ public class Function extends Expression implements FunctionCall {
case DATEDIFF:
return ValueLong.get(datediff(v0.getString(), v1.getTimestampNoCopy(), v2.getTimestampNoCopy()));
case DAYNAME:
synchronized(FORMAT_DAYNAME) {
return ValueString.get(FORMAT_DAYNAME.format(v0.getDateNoCopy()));
}
synchronized(FORMAT_DAYNAME) {
return ValueString.get(FORMAT_DAYNAME.format(v0.getDateNoCopy()));
}
case DAYOFMONTH:
return ValueInt.get(getDatePart(v0.getTimestampNoCopy(), Calendar.DAY_OF_MONTH));
case DAYOFWEEK:
......@@ -699,9 +699,9 @@ public class Function extends Expression implements FunctionCall {
case MONTH:
return ValueInt.get(getDatePart(v0.getTimestampNoCopy(), Calendar.MONTH));
case MONTHNAME:
synchronized(FORMAT_MONTHNAME) {
return ValueString.get(FORMAT_MONTHNAME.format(v0.getDateNoCopy()));
}
synchronized(FORMAT_MONTHNAME) {
return ValueString.get(FORMAT_MONTHNAME.format(v0.getDateNoCopy()));
}
case QUARTER:
return ValueInt.get((getDatePart(v0.getTimestamp(), Calendar.MONTH) - 1) / 3 + 1);
case SECOND:
......
......@@ -49,19 +49,19 @@ public class BtreeCursor implements Cursor {
}
void setCurrentRow(SearchRow searchRow) throws SQLException {
this.currentSearchRow = searchRow;
currentRow = null;
this.currentSearchRow = searchRow;
currentRow = null;
}
public Row get() throws SQLException {
if(currentRow == null && currentSearchRow != null) {
currentRow = index.getRow(currentSearchRow.getPos());
}
return currentRow;
if(currentRow == null && currentSearchRow != null) {
currentRow = index.getRow(currentSearchRow.getPos());
}
return currentRow;
}
public SearchRow getSearchRow() throws SQLException {
return currentSearchRow;
return currentSearchRow;
}
public int getPos() {
......@@ -76,8 +76,8 @@ public class BtreeCursor implements Cursor {
top.page.next(this, top.position);
if(currentSearchRow != null && last != null) {
if (index.compareRows(currentSearchRow, last) > 0) {
currentSearchRow = null;
currentRow = null;
currentSearchRow = null;
currentRow = null;
}
}
return currentSearchRow != null;
......
......@@ -24,9 +24,9 @@ public class FunctionCursor implements Cursor {
return row;
}
public SearchRow getSearchRow() throws SQLException {
return row;
}
public SearchRow getSearchRow() throws SQLException {
return row;
}
public int getPos() {
throw Message.getInternalError();
......
......@@ -24,9 +24,9 @@ public class HashCursor implements Cursor {
return row;
}
public SearchRow getSearchRow() throws SQLException {
return row;
}
public SearchRow getSearchRow() throws SQLException {
return row;
}
public int getPos() {
return row == null ? -1 : row.getPos();
......
......@@ -24,9 +24,9 @@ public class LinearHashCursor implements Cursor {
return row;
}
public SearchRow getSearchRow() throws SQLException {
return row;
}
public SearchRow getSearchRow() throws SQLException {
return row;
}
public int getPos() {
return row == null ? -1 : row.getPos();
......
......@@ -37,9 +37,9 @@ public class LinkedCursor implements Cursor {
return current;
}
public SearchRow getSearchRow() throws SQLException {
return current;
}
public SearchRow getSearchRow() throws SQLException {
return current;
}
public int getPos() {
throw Message.getInternalError();
......
......@@ -30,9 +30,9 @@ public class MetaCursor implements Cursor {
return current;
}
public SearchRow getSearchRow() throws SQLException {
return current;
}
public SearchRow getSearchRow() throws SQLException {
return current;
}
public int getPos() {
throw Message.getInternalError();
......
......@@ -29,9 +29,9 @@ public class RangeCursor implements Cursor {
return currentRow;
}
public SearchRow getSearchRow() throws SQLException {
return currentRow;
}
public SearchRow getSearchRow() throws SQLException {
return currentRow;
}
public int getPos() {
throw Message.getInternalError();
......
......@@ -138,11 +138,11 @@ public class ViewIndex extends Index {
}
int len;
if(first != null) {
len = first.getColumnCount();
len = first.getColumnCount();
} else if(last != null) {
len = last.getColumnCount();
len = last.getColumnCount();
} else {
len = 0;
len = 0;
}
for(int i=0; i < len; i++) {
if(first != null) {
......
......@@ -139,7 +139,6 @@ Serializable, Referenceable {
this.user = user;
}
public Reference getReference() throws NamingException {
debugCodeCall("getReference");
String factoryClassName = JdbcDataSourceFactory.class.getName();
......
......@@ -114,9 +114,9 @@ public class TraceSystem {
}
private String format(String module, String s) {
synchronized(dateFormat) {
return dateFormat.format(new Date()) + module + ": " + s;
}
synchronized(dateFormat) {
return dateFormat.format(new Date()) + module + ": " + s;
}
}
void write(int l, String module, String s, Throwable t) {
......
......@@ -192,13 +192,6 @@ public class ResultRemote implements ResultInterface {
}
}
// public void finalize() {
// if(!Constants.RUN_FINALIZE) {
// return;
// }
// close();
// }
private Value[] fetchRow(boolean sendFetch) throws SQLException {
synchronized (session) {
session.checkClosed();
......
......@@ -24,14 +24,14 @@ public class SimpleRowValue implements SearchRow {
return pos;
}
public Value getValue(int idx) {
return idx == index ? data : null;
return idx == index ? data : null;
}
public void setPos(int pos) {
this.pos = pos;
}
public void setValue(int idx, Value v) {
index = idx;
index = idx;
data = v;
}
......
......@@ -100,13 +100,13 @@ public class FtpServer implements Service {
Date now = new Date(), mod = new Date(f.lastModified());
String date;
if(mod.after(now) || Math.abs((now.getTime() - mod.getTime())/1000/60/60/24) > 180) {
synchronized(dateFormatOld) {
date = dateFormatOld.format(mod);
}
synchronized(dateFormatOld) {
date = dateFormatOld.format(mod);
}
} else {
synchronized(dateFormatNew) {
date = dateFormatNew.format(mod);
}
synchronized(dateFormatNew) {
date = dateFormatNew.format(mod);
}
}
buff.append(date);
buff.append(' ');
......@@ -115,9 +115,9 @@ public class FtpServer implements Service {
}
String formatLastModified(FileObject file) {
synchronized(dateFormat) {
return dateFormat.format(new Date(file.lastModified()));
}
synchronized(dateFormat) {
return dateFormat.format(new Date(file.lastModified()));
}
}
FileObject getFile(String path) {
......
......@@ -182,10 +182,10 @@ public class WebServer implements Service {
// TraceSystem.traceThrowable(e);
// }
// }
SimpleDateFormat format = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z", new Locale("en", ""));
synchronized(format) {
format.setTimeZone(TimeZone.getTimeZone("GMT"));
startDateTime = format.format(new Date());
SimpleDateFormat format = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z", new Locale("en", ""));
synchronized(format) {
format.setTimeZone(TimeZone.getTimeZone("GMT"));
startDateTime = format.format(new Date());
}
trace(startDateTime);
for(int i=0; i<LANGUAGES.length; i++) {
......@@ -278,7 +278,7 @@ public class WebServer implements Service {
}
public boolean getAllowOthers() {
return allowOthers;
return allowOthers;
}
void setSSL(boolean b) {
......@@ -415,12 +415,12 @@ public class WebServer implements Service {
return JdbcUtils.getConnection(driver, url, user, password);
}
public void setAllowShutdown(boolean b) {
this.allowShutdown = b;
}
public void setAllowShutdown(boolean b) {
this.allowShutdown = b;
}
boolean getAllowShutdown() {
return allowShutdown;
}
boolean getAllowShutdown() {
return allowShutdown;
}
}
......@@ -121,7 +121,7 @@ public class WebSession {
}
public HashMap getMainInfo() {
int todoRefactorMergeWithGetInfo;
int todoRefactorMergeWithGetInfo;
HashMap m = new HashMap();
m.putAll(map);
m.put("lastAccess", new Timestamp(lastAccess).toString());
......
......@@ -53,16 +53,16 @@ class WebThread extends Thread {
// TODO web: support online data editing like http://numsum.com/
WebThread(Socket socket, WebServer server) {
WebThread(Socket socket, WebServer server) {
this.server = server;
this.socket = socket;
setName("H2 Console thread");
}
void setSession(WebSession session, Properties attributes) {
int todoRefactor;
this.session = session;
this.attributes = attributes;
int todoRefactor;
this.session = session;
this.attributes = attributes;
}
protected String getComboBox(String[] elements, String selected) {
......@@ -146,7 +146,7 @@ class WebThread extends Thread {
cache=false;
mimeType = "text/html";
if (session == null) {
String hostname = socket.getInetAddress().getHostName();
String hostname = socket.getInetAddress().getHostName();
session = server.createNewSession(hostname);
if (!file.equals("notAllowed.jsp")) {
file = "index.do";
......@@ -463,9 +463,9 @@ class WebThread extends Thread {
}
private String adminShutdown() {
if(server.getAllowShutdown()) {
System.exit(0);
}
if(server.getAllowShutdown()) {
System.exit(0);
}
return "admin.jsp";
}
......
......@@ -137,6 +137,7 @@ public class FileStore {
public void close() throws IOException {
if(file != null) {
try {
trace("close", name, file);
file.close();
} finally {
file = null;
......@@ -145,12 +146,10 @@ public class FileStore {
}
public void closeSilently() {
if(file != null) {
try {
file.close();
} catch(IOException e) {
file = null;
}
try {
close();
} catch(IOException e) {
// ignore
}
}
......@@ -307,6 +306,7 @@ public class FileStore {
public void sync() {
try {
file.getFD().sync();
} catch(IOException e) {
// TODO log exception
......@@ -337,5 +337,11 @@ public class FileStore {
file.seek(filePos);
}
}
private static void trace(String method, String fileName, Object o) {
if(Constants.TRACE_IO) {
System.out.println("FileStore." + method + " " + fileName + " " + o);
}
}
}
......@@ -299,12 +299,12 @@ public abstract class Table extends SchemaObject {
}
private void remove(ObjectArray list, DbObject obj) {
if(list != null) {
int i = list.indexOf(obj);
if(i>=0) {
list.remove(i);
}
}
if(list != null) {
int i = list.indexOf(obj);
if(i>=0) {
list.remove(i);
}
}
}
public void removeIndex(Index index) {
......
......@@ -245,7 +245,7 @@ public class TableFilter implements ColumnResolver {
} else {
scanCount++;
if(cursor.next()) {
currentSearchRow = cursor.getSearchRow();
currentSearchRow = cursor.getSearchRow();
current = null;
// cursor.get();
state = FOUND;
......@@ -301,9 +301,9 @@ public class TableFilter implements ColumnResolver {
}
public Row get() throws SQLException {
if(current == null && currentSearchRow != null) {
current = cursor.get();
}
if(current == null && currentSearchRow != null) {
current = cursor.get();
}
return current;
}
......@@ -515,29 +515,29 @@ public class TableFilter implements ColumnResolver {
}
public Value getValue(Column column) throws SQLException {
if(Constants.INDEX_LOOKUP_NEW) {
if(currentSearchRow == null) {
return null;
}
int columnId = column.getColumnId();
if(current == null) {
Value v = currentSearchRow.getValue(columnId);
if(v != null) {
return v;
}
current = cursor.get();
}
return current.getValue(columnId);
} else {
if(currentSearchRow == null) {
return null;
}
if(current == null) {
current = cursor.get();
}
int columnId = column.getColumnId();
return current.getValue(columnId);
}
if(Constants.INDEX_LOOKUP_NEW) {
if(currentSearchRow == null) {
return null;
}
int columnId = column.getColumnId();
if(current == null) {
Value v = currentSearchRow.getValue(columnId);
if(v != null) {
return v;
}
current = cursor.get();
}
return current.getValue(columnId);
} else {
if(currentSearchRow == null) {
return null;
}
if(current == null) {
current = cursor.get();
}
int columnId = column.getColumnId();
return current.getValue(columnId);
}
}
public TableFilter getTableFilter() {
......
......@@ -58,47 +58,47 @@ public class Console implements ActionListener, MouseListener {
web = Server.createWebServer(args);
web.start();
} catch (SQLException e) {
if(web == null) {
e.printStackTrace();
} else {
System.out.println(web.getStatus());
}
if(web == null) {
e.printStackTrace();
} else {
System.out.println(web.getStatus());
}
}
Server tcp = null, odbc = null;
Server tcp = null, odbc = null;
try {
tcp = Server.createTcpServer(args);
tcp.start();
tcp = Server.createTcpServer(args);
tcp.start();
} catch(SQLException e) {
if(tcp == null) {
e.printStackTrace();
} else {
System.out.println(tcp.getStatus());
}
if(tcp == null) {
e.printStackTrace();
} else {
System.out.println(tcp.getStatus());
}
}
try {
odbc = Server.createOdbcServer(args);
odbc.start();
odbc = Server.createOdbcServer(args);
odbc.start();
} catch(SQLException e) {
if(odbc == null) {
e.printStackTrace();
} else {
System.out.println(odbc.getStatus());
}
if(odbc == null) {
e.printStackTrace();
} else {
System.out.println(odbc.getStatus());
}
}
if(!GraphicsEnvironment.isHeadless()) {
font = new Font("Dialog", Font.PLAIN, 11);
try {
InputStream in = getClass().getResourceAsStream("/org/h2/res/h2.png");
if(in != null) {
byte[] imageData = IOUtils.readBytesAndClose(in, -1);
icon = Toolkit.getDefaultToolkit().createImage(imageData);
}
if(!createTrayIcon()) {
showWindow(true);
}
} catch (Exception e) {
e.printStackTrace();
}
font = new Font("Dialog", Font.PLAIN, 11);
try {
InputStream in = getClass().getResourceAsStream("/org/h2/res/h2.png");
if(in != null) {
byte[] imageData = IOUtils.readBytesAndClose(in, -1);
icon = Toolkit.getDefaultToolkit().createImage(imageData);
}
if(!createTrayIcon()) {
showWindow(true);
}
} catch (Exception e) {
e.printStackTrace();
}
}
// start browser anyway (even if the server is already running)
// because some people don't look at the output,
......@@ -167,11 +167,11 @@ public class Console implements ActionListener, MouseListener {
final Frame frame = new Frame("H2 Console");
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
if(exit) {
System.exit(0);
} else {
frame.dispose();
}
if(exit) {
System.exit(0);
} else {
frame.dispose();
}
}
});
if(icon != null) {
......@@ -230,7 +230,7 @@ public class Console implements ActionListener, MouseListener {
* INTERNAL
*/
public void actionPerformed(ActionEvent e) {
String command = e.getActionCommand();
String command = e.getActionCommand();
if ("exit".equals(command)) {
System.exit(0);
} else if ("console".equals(command)) {
......
......@@ -36,7 +36,9 @@ public class FileUtils {
public static RandomAccessFile openRandomAccessFile(String fileName, String mode) throws IOException {
fileName = translateFileName(fileName);
try {
return new RandomAccessFile(fileName, mode);
RandomAccessFile file = new RandomAccessFile(fileName, mode);
trace("openRandomAccessFile", fileName, file);
return file;
} catch(IOException e) {
freeMemoryAndFinalize();
return new RandomAccessFile(fileName, mode);
......@@ -45,6 +47,7 @@ public class FileUtils {
public static void setLength(RandomAccessFile file, long newLength) throws IOException {
try {
trace("setLength", null, file);
file.setLength(newLength);
} catch(IOException e) {
long length = file.length();
......@@ -88,7 +91,9 @@ public class FileUtils {
public static FileInputStream openFileInputStream(String fileName) throws IOException {
fileName = translateFileName(fileName);
return new FileInputStream(fileName);
FileInputStream in = new FileInputStream(fileName);
trace("openFileInputStream", fileName, in);
return in;
}
public static FileOutputStream openFileOutputStream(String fileName) throws IOException, SQLException {
......@@ -96,7 +101,9 @@ public class FileUtils {
try {
File file = new File(fileName);
FileUtils.createDirs(file.getAbsolutePath());
return new FileOutputStream(fileName);
FileOutputStream out = new FileOutputStream(fileName);
trace("openFileOutputStream", fileName, out);
return out;
} catch(IOException e) {
freeMemoryAndFinalize();
return new FileOutputStream(fileName);
......@@ -104,6 +111,7 @@ public class FileUtils {
}
private static void freeMemoryAndFinalize() {
trace("freeMemoryAndFinalize", null, null);
Runtime rt = Runtime.getRuntime();
long mem = rt.freeMemory();
for(int i=0; i<16; i++) {
......@@ -138,6 +146,7 @@ public class FileUtils {
throw Message.getSQLException(Message.FILE_RENAME_FAILED_2, new String[]{oldName, newName + " (exists)"}, null);
}
for(int i=0; i<Constants.MAX_FILE_RETRY; i++) {
trace("rename", oldName + " >" + newName, null);
boolean ok = oldFile.renameTo(newFile);
if(ok) {
return;
......@@ -232,6 +241,7 @@ public class FileUtils {
File file = new File(fileName);
if(file.exists()) {
for(int i=0; i<Constants.MAX_FILE_RETRY; i++) {
trace("delete", fileName, null);
boolean ok = file.delete();
if(ok) {
return;
......@@ -295,6 +305,7 @@ public class FileUtils {
memoryFiles.remove(fileName);
return;
}
trace("tryDelete", fileName, null);
new File(fileName).delete();
}
......@@ -392,7 +403,7 @@ public class FileUtils {
}
String base = f.getCanonicalPath();
if(!base.endsWith(File.separator)) {
base += File.separator;
base += File.separator;
}
for(int i=0; i<list.length; i++) {
list[i] = base + list[i];
......@@ -482,4 +493,10 @@ public class FileUtils {
return new File(fileName).canWrite();
}
private static void trace(String method, String fileName, Object o) {
if(Constants.TRACE_IO) {
System.out.println("FileUtils." + method + " " + fileName + " " + o);
}
}
}
......@@ -27,6 +27,7 @@ public class IOUtils {
public static void closeSilently(OutputStream out) {
if(out != null) {
try {
trace("closeSilently", null, out);
out.close();
} catch(IOException e) {
// ignore
......@@ -97,6 +98,7 @@ public class IOUtils {
public static void closeSilently(InputStream in) {
if(in != null) {
try {
trace("closeSilently", null, in);
in.close();
} catch(IOException e) {
// ignore
......@@ -240,5 +242,11 @@ public class IOUtils {
throw Message.convert(e);
}
}
private static void trace(String method, String fileName, Object o) {
if(Constants.TRACE_IO) {
System.out.println("IOUtils." + method + " " + fileName + " " + o);
}
}
}
......@@ -365,7 +365,7 @@ public class StringUtils {
public static String formatDateTime(Date date, String format, String locale, String timezone) throws SQLException {
SimpleDateFormat dateFormat = getDateFormat(format, locale, timezone);
synchronized(dateFormat) {
return dateFormat.format(date);
return dateFormat.format(date);
}
}
......@@ -376,7 +376,7 @@ public class StringUtils {
SimpleDateFormat dateFormat = getDateFormat(format, locale, timezone);
try {
synchronized(dateFormat) {
return dateFormat.parse(date);
return dateFormat.parse(date);
}
} catch(ParseException e) {
throw Message.getSQLException(Message.PARSE_ERROR_1, date);
......@@ -385,8 +385,8 @@ public class StringUtils {
private static SimpleDateFormat getDateFormat(String format, String locale, String timezone) throws SQLException {
try {
// currently, a new instance is create for each call
// however, could cache the last few instances
// currently, a new instance is create for each call
// however, could cache the last few instances
SimpleDateFormat df;
if(locale == null) {
df = new SimpleDateFormat(format);
......
......@@ -93,11 +93,42 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
test.printSystem();
/*
runscript from 'C:\download\backup.sql';
alter table download_link add html_ltarget_ord INTEGER(10) default 0;
alter table navigation_link add html_ltarget_ord INTEGER(10) default 0;
alter table web_link add html_ltarget_ord INTEGER(10) default 0;
ALTER TABLE navigation_page_content DROP COLUMN parent_type_id;
ALTER TABLE entity_info DROP COLUMN parent_type_id;
ALTER TABLE navigation_point_content DROP COLUMN parent_type_id;
ALTER TABLE paragraph_proxy DROP COLUMN parent_type_id;
ALTER TABLE patch DROP COLUMN parent_type_id;
ALTER TABLE page_content DROP COLUMN parent_type_id;
ALTER TABLE image_gallery_image_usage_ref DROP COLUMN ref_image_gallery;
ALTER TABLE navigation_page_content_reference DROP COLUMN ref_element_provider;
ALTER TABLE paragraph_proxy DROP COLUMN ref_page_content;
alter table navigation_page_content_reference add contained BOOLEAN(1) default false;
update navigation_page_content_reference set contained=true where state=7;
alter table navigation_page_content add contained BOOLEAN(1) default false;
update navigation_page_content set contained=true where state=7;
alter table navigation_point_content add contained BOOLEAN(1) default false;
update navigation_point_content set contained=true where state=7;
alter table weblica_link add contained BOOLEAN(1) default false;
update weblica_link set contained=true where state=7;
alter table image_usage add contained BOOLEAN(1) default false;
update image_usage set contained=true where state=7;
alter table paragraph_proxy add contained BOOLEAN(1) default false;
make sure INDEX_LOOKUP_NEW = is true by default.
Test Console (batch, javaw, different platforms)
backup.sql / lob file problem
Change documentation and default database for H2 Console: jdbc:h2:~/test
testHalt
......@@ -158,9 +189,7 @@ support translated exceptions (english + translated)
select * from H2.PUBLIC.ORDERS
Wre es nicht besser, unabhngig von DB_CLOSE_DELAY eine Datenbank offen
zu halten, solange dafr offene PooledConnections vorhanden sind?
keep db open (independent of DB_CLOSE_DELAY) while a PooledConnections exists.
*/
......
......@@ -38,11 +38,11 @@ Initial Developer: H2 Group
<!--
<security-constraint>
<web-resource-collection>
<web-resource-collection>
<web-resource-name>H2 Console</web-resource-name>
<url-pattern>/console/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
......
......@@ -459,6 +459,8 @@ netscape mywebpage javaplayer fuse davidlbarron helps player appfuse awt
gridwidth editable pressed entered awt east toolkit insets exited grid mouse west resizable popup focusable bag anchor
headless
polish javaee resp xsi instances tomek realm xsd appended auth polski
signsoft intellibo jdo intelli middleware ute war sends snippet
gallery ord javaw weblica ltarget
### check those again:
populate slowly xacon inser maxbqualsize counter regards attaching official xatest
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论