提交 656bf9e6 authored 作者: Thomas Mueller's avatar Thomas Mueller

Support Google App Engine

上级 8f1768e1
...@@ -62,19 +62,25 @@ public class WriterThread implements Runnable { ...@@ -62,19 +62,25 @@ public class WriterThread implements Runnable {
} }
/** /**
* Create and start a new writer thread for the given database. * Create and start a new writer thread for the given database. If the
* thread can't be created, this method returns null.
* *
* @param database the database * @param database the database
* @param writeDelay the delay * @param writeDelay the delay
* @return the writer thread object * @return the writer thread object or null
*/ */
public static WriterThread create(Database database, int writeDelay) { public static WriterThread create(Database database, int writeDelay) {
WriterThread writer = new WriterThread(database, writeDelay); WriterThread writer = new WriterThread(database, writeDelay);
Thread thread = new Thread(writer); try {
thread.setName("H2 Log Writer " + database.getShortName()); Thread thread = new Thread(writer);
thread.setDaemon(true); thread.setName("H2 Log Writer " + database.getShortName());
thread.start(); thread.setDaemon(true);
return writer; thread.start();
return writer;
} catch (Exception e) {
// support Google App Engine
return null;
}
} }
private LogSystem getLog() { private LogSystem getLog() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论