Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sentinel
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
sentinel
Commits
4fdbb3fb
Commit
4fdbb3fb
authored
Jul 29, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
28c94434
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
SqlConcurrentController.java
.../java/com/egolm/sentinel/web/SqlConcurrentController.java
+3
-3
sqlConcurrent.html
src/main/resources/page/sqlConcurrent.html
+1
-1
No files found.
src/main/java/com/egolm/sentinel/web/SqlConcurrentController.java
View file @
4fdbb3fb
...
@@ -34,10 +34,10 @@ import com.egolm.sentinel.config.XRException;
...
@@ -34,10 +34,10 @@ import com.egolm.sentinel.config.XRException;
public
class
SqlConcurrentController
{
public
class
SqlConcurrentController
{
@PostMapping
(
"concurrentSql"
)
@PostMapping
(
"concurrentSql"
)
public
Rjx
doExecute
(
String
jdbcUrl
,
String
username
,
String
password
,
String
sql
,
String
parameters
,
Integer
threadCount
,
Integer
executeCount
,
Integer
isOpenTx
)
throws
InterruptedException
,
IOException
,
SQLException
{
public
Rjx
doExecute
(
String
jdbcUrl
,
String
username
,
String
password
,
String
sql
,
String
parameters
,
Integer
threadCount
,
Integer
executeCount
,
Boolean
isOpenTx
)
throws
InterruptedException
,
IOException
,
SQLException
{
threadCount
=
threadCount
==
null
?
1
:
threadCount
;
threadCount
=
threadCount
==
null
?
1
:
threadCount
;
executeCount
=
executeCount
==
null
?
1
:
executeCount
;
executeCount
=
executeCount
==
null
?
1
:
executeCount
;
isOpenTx
=
isOpenTx
==
null
?
0
:
isOpenTx
;
isOpenTx
=
isOpenTx
==
null
?
false
:
isOpenTx
;
ThreadPoolExecutor
executor
=
new
ThreadPoolExecutor
(
threadCount
,
threadCount
,
5
,
TimeUnit
.
MINUTES
,
new
LinkedBlockingQueue
<
Runnable
>(
executeCount
));
ThreadPoolExecutor
executor
=
new
ThreadPoolExecutor
(
threadCount
,
threadCount
,
5
,
TimeUnit
.
MINUTES
,
new
LinkedBlockingQueue
<
Runnable
>(
executeCount
));
CountDownLatch
latch
=
new
CountDownLatch
(
executeCount
);
CountDownLatch
latch
=
new
CountDownLatch
(
executeCount
);
...
@@ -46,7 +46,7 @@ public class SqlConcurrentController {
...
@@ -46,7 +46,7 @@ public class SqlConcurrentController {
try
{
try
{
dataSource
=
this
.
getDataSource
(
jdbcUrl
,
username
,
password
);
dataSource
=
this
.
getDataSource
(
jdbcUrl
,
username
,
password
);
TransactionTemplate
txTemplate
=
null
;
TransactionTemplate
txTemplate
=
null
;
if
(
isOpenTx
.
intValue
()
==
1
)
{
if
(
isOpenTx
)
{
DataSourceTransactionManager
txManager
=
new
DataSourceTransactionManager
(
dataSource
);
DataSourceTransactionManager
txManager
=
new
DataSourceTransactionManager
(
dataSource
);
txTemplate
=
new
TransactionTemplate
(
txManager
);
txTemplate
=
new
TransactionTemplate
(
txManager
);
}
}
...
...
src/main/resources/page/sqlConcurrent.html
View file @
4fdbb3fb
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
<el-input
size=
"mini"
placeholder=
"参数"
v-model=
"form.parameters"
style=
"width:300px;"
></el-input>
<el-input
size=
"mini"
placeholder=
"参数"
v-model=
"form.parameters"
style=
"width:300px;"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-
input
size=
"mini"
placeholder=
"参数"
v-model=
"form.parameters"
style=
"width:300px;"
></el-input
>
<el-
checkbox
v-model=
"form.isOpenTx"
>
开启事务
</el-checkbox
>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
size=
"mini"
type=
"primary"
@
click=
"doExecute"
>
执行
</el-button>
<el-button
size=
"mini"
type=
"primary"
@
click=
"doExecute"
>
执行
</el-button>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment