Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
880d7dd2
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
880d7dd2
编写于
6月 25, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
JDBC connections init fixed. Active object set.
Former-commit-id:
f79468d3
上级
3f1606ee
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
14 deletion
+13
-14
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCDataSource.java
...src/org/jkiss/dbeaver/model/impl/jdbc/JDBCDataSource.java
+5
-5
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCExecutionContext.java
...g/jkiss/dbeaver/model/impl/jdbc/JDBCExecutionContext.java
+3
-7
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/struct/DBSDataSourceContainer.java
...rg/jkiss/dbeaver/model/struct/DBSDataSourceContainer.java
+2
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DataSourceDescriptor.java
.../src/org/jkiss/dbeaver/registry/DataSourceDescriptor.java
+3
-2
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCDataSource.java
浏览文件 @
880d7dd2
...
...
@@ -72,8 +72,8 @@ public abstract class JDBCDataSource
throws
DBException
{
this
.
container
=
container
;
this
.
executionContext
=
new
JDBCExecutionContext
(
this
,
"Main"
,
true
);
this
.
executionContext
.
connect
(
monitor
);
this
.
executionContext
=
new
JDBCExecutionContext
(
this
,
"Main"
);
this
.
executionContext
.
connect
(
monitor
,
null
,
null
,
false
);
}
protected
Connection
openConnection
(
DBRProgressMonitor
monitor
,
String
purpose
)
...
...
@@ -208,8 +208,8 @@ public abstract class JDBCDataSource
@Override
public
DBCExecutionContext
openIsolatedContext
(
@NotNull
DBRProgressMonitor
monitor
,
@NotNull
String
purpose
)
throws
DBException
{
JDBCExecutionContext
context
=
new
JDBCExecutionContext
(
this
,
purpose
,
false
);
context
.
connect
(
monitor
);
JDBCExecutionContext
context
=
new
JDBCExecutionContext
(
this
,
purpose
);
context
.
connect
(
monitor
,
null
,
null
,
true
);
return
context
;
}
...
...
@@ -266,7 +266,7 @@ public abstract class JDBCDataSource
{
if
(!
isEmbeddedDataSource
()
&&
container
.
getPreferenceStore
().
getBoolean
(
DBeaverPreferences
.
META_SEPARATE_CONNECTION
))
{
synchronized
(
this
)
{
this
.
metaContext
=
new
JDBCExecutionContext
(
this
,
"Metadata"
,
true
);
this
.
metaContext
=
new
JDBCExecutionContext
(
this
,
"Metadata"
);
this
.
metaContext
.
connect
(
monitor
,
true
,
null
,
false
);
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCExecutionContext.java
浏览文件 @
880d7dd2
...
...
@@ -20,11 +20,9 @@ package org.jkiss.dbeaver.model.impl.jdbc;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.DBeaverPreferences
;
import
org.jkiss.dbeaver.core.CoreMessages
;
import
org.jkiss.dbeaver.core.Log
;
import
org.jkiss.dbeaver.model.DBPDataSource
;
import
org.jkiss.dbeaver.model.DBPPreferenceStore
;
import
org.jkiss.dbeaver.model.DBPTransactionIsolation
;
import
org.jkiss.dbeaver.model.exec.*
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCSession
;
...
...
@@ -46,17 +44,15 @@ public class JDBCExecutionContext implements DBCExecutionContext, DBCTransaction
@NotNull
private
final
JDBCDataSource
dataSource
;
private
final
boolean
primaryContext
;
private
volatile
Connection
connection
;
private
final
String
purpose
;
private
volatile
Boolean
autoCommit
;
private
volatile
Integer
transactionIsolationLevel
;
public
JDBCExecutionContext
(
@NotNull
JDBCDataSource
dataSource
,
String
purpose
,
boolean
primary
)
public
JDBCExecutionContext
(
@NotNull
JDBCDataSource
dataSource
,
String
purpose
)
{
this
.
dataSource
=
dataSource
;
this
.
purpose
=
purpose
;
this
.
primaryContext
=
primary
;
}
private
Connection
getConnection
()
{
...
...
@@ -97,7 +93,7 @@ public class JDBCExecutionContext implements DBCExecutionContext, DBCTransaction
log
.
warn
(
"Can't set auto-commit state"
,
e
);
//$NON-NLS-1$
}
if
(
txnLevel
!=
null
)
{
if
(
!
this
.
autoCommit
&&
txnLevel
!=
null
)
{
try
{
connection
.
setTransactionIsolation
(
txnLevel
);
this
.
transactionIsolationLevel
=
txnLevel
;
...
...
@@ -116,7 +112,7 @@ public class JDBCExecutionContext implements DBCExecutionContext, DBCTransaction
QMUtils
.
getDefaultHandler
().
handleContextOpen
(
this
,
!
this
.
autoCommit
);
// Copy context state
this
.
dataSource
.
initializeContextState
(
monitor
,
this
,
!
primaryContext
||
forceActiveObject
);
this
.
dataSource
.
initializeContextState
(
monitor
,
this
,
forceActiveObject
);
// Add self to context list
this
.
dataSource
.
allContexts
.
add
(
this
);
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/struct/DBSDataSourceContainer.java
浏览文件 @
880d7dd2
...
...
@@ -77,6 +77,8 @@ public interface DBSDataSourceContainer extends DBSObject, DBDPreferences
void
setDefaultTransactionsIsolation
(
DBPTransactionIsolation
isolationLevel
);
String
getDefaultActiveObject
();
/**
* Search for object filter which corresponds specified object type and parent object.
* Search filter which match any super class or interface implemented by specified type.
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DataSourceDescriptor.java
浏览文件 @
880d7dd2
...
...
@@ -394,6 +394,7 @@ public class DataSourceDescriptor
}
}
@Override
public
String
getDefaultActiveObject
()
{
return
preferenceStore
.
getString
(
DBeaverPreferences
.
DEFAULT_ACTIVE_OBJECT
);
}
...
...
@@ -637,7 +638,7 @@ public class DataSourceDescriptor
dataSource
.
initialize
(
monitor
);
// Change connection properties
prepareContext
(
monitor
);
initConnectionState
(
monitor
);
}
connectFailed
=
false
;
...
...
@@ -675,7 +676,7 @@ public class DataSourceDescriptor
}
}
private
void
prepareContext
(
DBRProgressMonitor
monitor
)
throws
DBException
{
private
void
initConnectionState
(
DBRProgressMonitor
monitor
)
throws
DBException
{
if
(
dataSource
==
null
)
{
return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录