Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
013a9c2b
提交
013a9c2b
authored
17 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
75648425
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
19 行增加
和
10 行删除
+19
-10
ConnectionInfo.java
h2/src/main/org/h2/engine/ConnectionInfo.java
+2
-1
Constants.java
h2/src/main/org/h2/engine/Constants.java
+2
-1
Database.java
h2/src/main/org/h2/engine/Database.java
+12
-5
SessionRemote.java
h2/src/main/org/h2/engine/SessionRemote.java
+3
-3
没有找到文件。
h2/src/main/org/h2/engine/ConnectionInfo.java
浏览文件 @
013a9c2b
...
...
@@ -42,7 +42,8 @@ public class ConnectionInfo {
// TODO document these settings
String
[]
connectionTime
=
new
String
[]{
"PASSWORD"
,
"USER"
,
"STORAGE"
,
"FILE_LOCK"
,
"CIPHER"
,
"DB_CLOSE_ON_EXIT"
,
"IGNORE_UNKNOWN_SETTINGS"
,
"IFEXISTS"
,
"RECOVER"
,
"CREATE"
,
"CACHE_TYPE"
"IGNORE_UNKNOWN_SETTINGS"
,
"IFEXISTS"
,
"RECOVER"
,
"CREATE"
,
"CACHE_TYPE"
,
"WRITE_MODE_LOG"
,
"WRITE_MODE_DATA"
};
for
(
int
i
=
0
;
i
<
connectionTime
.
length
;
i
++)
{
String
key
=
connectionTime
[
i
];
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Constants.java
浏览文件 @
013a9c2b
...
...
@@ -58,6 +58,7 @@ package org.h2.engine;
* - TestSystemExit
* - Test with hibernate
* - Scan for viruses
* - Newsletter: send to h2database-news@googlegroups.com (http://groups.google.com/group/h2database-news)
* - newsletter: prepare, send (always send to BCC!!)
* - http://maven.apache.org/guides/mini/guide-ibiblio-upload.html
* - Add to freshmeat, http://code.google.com/p/h2database/downloads/list
...
...
@@ -200,7 +201,7 @@ public class Constants {
public
static
final
String
CONN_URL_INTERNAL
=
"jdbc:default:connection"
;
public
static
final
String
CONN_URL_COLUMNLIST
=
"jdbc:columnlist:connection"
;
public
static
final
int
VIEW_
COST
_CACHE_SIZE
=
64
;
public
static
final
int
VIEW_
INDEX
_CACHE_SIZE
=
64
;
public
static
final
int
VIEW_COST_CACHE_MAX_AGE
=
10000
;
// 10 seconds
public
static
final
int
MAX_PARAMETER_INDEX
=
100000
;
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/Database.java
浏览文件 @
013a9c2b
...
...
@@ -135,6 +135,7 @@ public class Database implements DataHandler {
private
String
cacheType
;
private
boolean
indexSummaryValid
=
true
;
private
Object
lobSyncObject
=
new
Object
();
private
String
writeModeLog
,
writeModeData
;
public
static
void
setInitialPowerOffCount
(
int
count
)
{
initialPowerOffCount
=
count
;
...
...
@@ -291,11 +292,11 @@ public class Database implements DataHandler {
return
traceSystem
.
getTrace
(
module
);
}
public
FileStore
openFile
(
String
name
,
boolean
mustExist
)
throws
SQLException
{
public
FileStore
openFile
(
String
name
,
String
mode
,
boolean
mustExist
)
throws
SQLException
{
if
(
mustExist
&&
!
FileUtils
.
exists
(
name
))
{
throw
Message
.
getSQLException
(
Message
.
FILE_NOT_FOUND_1
,
name
);
}
FileStore
store
=
FileStore
.
open
(
this
,
name
,
getMagic
(),
cipher
,
filePasswordHash
);
FileStore
store
=
FileStore
.
open
(
this
,
name
,
mode
,
getMagic
(),
cipher
,
filePasswordHash
);
try
{
store
.
init
();
}
catch
(
SQLException
e
)
{
...
...
@@ -312,11 +313,11 @@ public class Database implements DataHandler {
}
private
void
openFileData
()
throws
SQLException
{
fileData
=
new
DiskFile
(
this
,
databaseName
+
Constants
.
SUFFIX_DATA_FILE
,
true
,
true
,
Constants
.
DEFAULT_CACHE_SIZE
);
fileData
=
new
DiskFile
(
this
,
databaseName
+
Constants
.
SUFFIX_DATA_FILE
,
writeModeData
,
true
,
true
,
Constants
.
DEFAULT_CACHE_SIZE
);
}
private
void
openFileIndex
()
throws
SQLException
{
fileIndex
=
new
DiskFile
(
this
,
databaseName
+
Constants
.
SUFFIX_INDEX_FILE
,
false
,
logIndexChanges
,
Constants
.
DEFAULT_CACHE_SIZE_INDEX
);
fileIndex
=
new
DiskFile
(
this
,
databaseName
+
Constants
.
SUFFIX_INDEX_FILE
,
"rw"
,
false
,
logIndexChanges
,
Constants
.
DEFAULT_CACHE_SIZE_INDEX
);
}
public
DataPage
getDataPage
()
{
...
...
@@ -348,6 +349,8 @@ public class Database implements DataHandler {
this
.
databaseShortName
=
parseDatabaseShortName
();
this
.
cipher
=
cipher
;
String
lockMethodName
=
ci
.
removeProperty
(
"FILE_LOCK"
,
null
);
this
.
writeModeLog
=
ci
.
removeProperty
(
"WRITE_MODE_LOG"
,
"rw"
).
toLowerCase
();
this
.
writeModeData
=
ci
.
removeProperty
(
"WRITE_MODE_DATA"
,
"rw"
).
toLowerCase
();
this
.
fileLockMethod
=
FileLock
.
getFileLockMethod
(
lockMethodName
);
this
.
textStorage
=
ci
.
getTextStorage
();
this
.
databaseURL
=
ci
.
getURL
();
...
...
@@ -522,7 +525,7 @@ public class Database implements DataHandler {
removeUnusedStorages
();
systemSession
.
commit
();
if
(!
readOnly
)
{
emergencyReserve
=
openFile
(
createTempFile
(),
false
);
emergencyReserve
=
openFile
(
createTempFile
(),
"rw"
,
false
);
emergencyReserve
.
autoDelete
();
emergencyReserve
.
setLength
(
Constants
.
EMERGENCY_SPACE_INITIAL
);
}
...
...
@@ -1487,4 +1490,8 @@ public class Database implements DataHandler {
return
lobSyncObject
;
}
public
String
getWriteModeLog
()
{
return
writeModeLog
;
}
}
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/engine/SessionRemote.java
浏览文件 @
013a9c2b
...
...
@@ -356,16 +356,16 @@ public class SessionRemote implements SessionInterface, DataHandler {
throw
Message
.
getSQLException
(
Message
.
FILE_CORRUPTED_1
,
"wrong checksum"
);
}
public
FileStore
openFile
(
String
name
,
boolean
mustExist
)
throws
SQLException
{
public
FileStore
openFile
(
String
name
,
String
mode
,
boolean
mustExist
)
throws
SQLException
{
if
(
mustExist
&&
!
FileUtils
.
exists
(
name
))
{
throw
Message
.
getSQLException
(
Message
.
FILE_CORRUPTED_1
,
name
);
}
FileStore
store
;
byte
[]
magic
=
Constants
.
MAGIC_FILE_HEADER
.
getBytes
();
if
(
cipher
==
null
)
{
store
=
FileStore
.
open
(
this
,
name
,
magic
);
store
=
FileStore
.
open
(
this
,
name
,
m
ode
,
m
agic
);
}
else
{
store
=
FileStore
.
open
(
this
,
name
,
magic
,
cipher
,
fileEncryptionKey
,
0
);
store
=
FileStore
.
open
(
this
,
name
,
m
ode
,
m
agic
,
cipher
,
fileEncryptionKey
,
0
);
}
store
.
setCheckedWriting
(
false
);
try
{
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论