Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
e0dde17c
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,发现更多精彩内容 >>
提交
e0dde17c
编写于
6月 22, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
QM refactoring (remove UI interactions from QM).
auto-commit switcher logging added
上级
1de8b2ee
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
46 addition
and
16 deletion
+46
-16
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCExecutionContext.java
...g/jkiss/dbeaver/model/impl/jdbc/JDBCExecutionContext.java
+1
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DataSourceDescriptor.java
.../src/org/jkiss/dbeaver/registry/DataSourceDescriptor.java
+3
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/qm/meta/QMMCollector.java
...e/src/org/jkiss/dbeaver/runtime/qm/meta/QMMCollector.java
+0
-9
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/DataSourcePropertyTester.java
...rg/jkiss/dbeaver/ui/actions/DataSourcePropertyTester.java
+42
-7
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCExecutionContext.java
浏览文件 @
e0dde17c
...
...
@@ -258,6 +258,7 @@ public class JDBCExecutionContext implements DBCExecutionContext, DBCTransaction
public
void
setAutoCommit
(
DBRProgressMonitor
monitor
,
boolean
autoCommit
)
throws
DBCException
{
monitor
.
subTask
(
"Set JDBC connection auto-commit "
+
autoCommit
);
try
{
connection
.
setAutoCommit
(
autoCommit
);
this
.
autoCommit
=
null
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DataSourceDescriptor.java
浏览文件 @
e0dde17c
...
...
@@ -308,11 +308,14 @@ public class DataSourceDescriptor
@Override
public
void
run
(
DBRProgressMonitor
monitor
)
throws
InvocationTargetException
,
InterruptedException
{
monitor
.
beginTask
(
"Set auto-commit mode"
,
1
);
try
{
// Change auto-commit mode
txnManager
.
setAutoCommit
(
monitor
,
autoCommit
);
}
catch
(
DBCException
e
)
{
throw
new
InvocationTargetException
(
e
);
}
finally
{
monitor
.
done
();
}
}
});
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/qm/meta/QMMCollector.java
浏览文件 @
e0dde17c
...
...
@@ -29,8 +29,6 @@ import org.jkiss.dbeaver.runtime.AbstractJob;
import
org.jkiss.dbeaver.runtime.qm.DefaultExecutionHandler
;
import
org.jkiss.dbeaver.runtime.qm.QMMetaEvent
;
import
org.jkiss.dbeaver.runtime.qm.QMMetaListener
;
import
org.jkiss.dbeaver.ui.ICommandIds
;
import
org.jkiss.dbeaver.ui.actions.DataSourcePropertyTester
;
import
java.util.*
;
...
...
@@ -179,10 +177,6 @@ public class QMMCollector extends DefaultExecutionHandler {
}
fireMetaEvent
(
sessionInfo
,
QMMetaEvent
.
Action
.
UPDATE
);
}
// Fire transactional mode change
DataSourcePropertyTester
.
firePropertyChange
(
DataSourcePropertyTester
.
PROP_TRANSACTIONAL
);
DataSourcePropertyTester
.
firePropertyChange
(
DataSourcePropertyTester
.
PROP_TRANSACTION_ACTIVE
);
DataSourcePropertyTester
.
fireCommandRefresh
(
ICommandIds
.
CMD_TOGGLE_AUTOCOMMIT
);
}
@Override
...
...
@@ -195,7 +189,6 @@ public class QMMCollector extends DefaultExecutionHandler {
fireMetaEvent
(
oldTxn
,
QMMetaEvent
.
Action
.
END
);
}
}
DataSourcePropertyTester
.
firePropertyChange
(
DataSourcePropertyTester
.
PROP_TRANSACTION_ACTIVE
);
}
@Override
...
...
@@ -208,7 +201,6 @@ public class QMMCollector extends DefaultExecutionHandler {
fireMetaEvent
(
oldTxn
,
QMMetaEvent
.
Action
.
END
);
}
}
DataSourcePropertyTester
.
firePropertyChange
(
DataSourcePropertyTester
.
PROP_TRANSACTION_ACTIVE
);
}
@Override
...
...
@@ -245,7 +237,6 @@ public class QMMCollector extends DefaultExecutionHandler {
fireMetaEvent
(
exec
,
QMMetaEvent
.
Action
.
BEGIN
);
}
}
DataSourcePropertyTester
.
firePropertyChange
(
DataSourcePropertyTester
.
PROP_TRANSACTION_ACTIVE
);
}
@Override
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/DataSourcePropertyTester.java
浏览文件 @
e0dde17c
...
...
@@ -26,14 +26,12 @@ import org.jkiss.dbeaver.core.DBeaverCore;
import
org.jkiss.dbeaver.core.Log
;
import
org.jkiss.dbeaver.model.DBPContextProvider
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.exec.DBCException
;
import
org.jkiss.dbeaver.model.exec.DBCExecutionContext
;
import
org.jkiss.dbeaver.model.exec.DBCTransactionManager
;
import
org.jkiss.dbeaver.runtime.qm.meta.QMMSessionInfo
;
import
org.jkiss.dbeaver.runtime.qm.meta.QMMStatementExecuteInfo
;
import
org.jkiss.dbeaver.runtime.qm.meta.QMMTransactionInfo
;
import
org.jkiss.dbeaver.runtime.qm.meta.QMMTransactionSavepointInfo
;
import
org.jkiss.dbeaver.model.exec.*
;
import
org.jkiss.dbeaver.model.qm.QMUtils
;
import
org.jkiss.dbeaver.runtime.qm.DefaultExecutionHandler
;
import
org.jkiss.dbeaver.runtime.qm.meta.*
;
import
org.jkiss.dbeaver.ui.ActionUtils
;
import
org.jkiss.dbeaver.ui.ICommandIds
;
/**
* DatabaseEditorPropertyTester
...
...
@@ -49,6 +47,7 @@ public class DataSourcePropertyTester extends PropertyTester
public
DataSourcePropertyTester
()
{
super
();
QMUtils
.
registerHandler
(
new
QMEventsHandler
());
}
@Override
...
...
@@ -114,4 +113,40 @@ public class DataSourcePropertyTester extends PropertyTester
});
}
}
// QM events handler
private
static
class
QMEventsHandler
extends
DefaultExecutionHandler
{
@Override
public
String
getHandlerName
()
{
return
DataSourcePropertyTester
.
class
.
getName
();
}
@Override
public
synchronized
void
handleTransactionAutocommit
(
DBCExecutionContext
context
,
boolean
autoCommit
)
{
// Fire transactional mode change
DataSourcePropertyTester
.
firePropertyChange
(
DataSourcePropertyTester
.
PROP_TRANSACTIONAL
);
DataSourcePropertyTester
.
firePropertyChange
(
DataSourcePropertyTester
.
PROP_TRANSACTION_ACTIVE
);
DataSourcePropertyTester
.
fireCommandRefresh
(
ICommandIds
.
CMD_TOGGLE_AUTOCOMMIT
);
}
@Override
public
synchronized
void
handleTransactionCommit
(
DBCExecutionContext
context
)
{
DataSourcePropertyTester
.
firePropertyChange
(
DataSourcePropertyTester
.
PROP_TRANSACTION_ACTIVE
);
}
@Override
public
synchronized
void
handleTransactionRollback
(
DBCExecutionContext
context
,
DBCSavepoint
savepoint
)
{
DataSourcePropertyTester
.
firePropertyChange
(
DataSourcePropertyTester
.
PROP_TRANSACTION_ACTIVE
);
}
@Override
public
synchronized
void
handleStatementExecuteBegin
(
DBCStatement
statement
)
{
DataSourcePropertyTester
.
firePropertyChange
(
DataSourcePropertyTester
.
PROP_TRANSACTION_ACTIVE
);
}
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录