|
@@ -57,7 +57,7 @@ public class TransactionSupportAsyncJobServiceTest extends SimpleWebApplicationT
|
|
|
Thread.sleep(50);
|
|
|
throw new RuntimeException("1234");
|
|
|
}, true);
|
|
|
- for (int i = 0; i < 100; i++) {
|
|
|
+ for (int i = 0; i < 10; i++) {
|
|
|
jobContainer.submit(() -> sqlExecutor.insert("insert into test values('test')", null), true);
|
|
|
}
|
|
|
|
|
@@ -72,15 +72,17 @@ public class TransactionSupportAsyncJobServiceTest extends SimpleWebApplicationT
|
|
|
public void testSimple() throws Exception {
|
|
|
try {
|
|
|
BatchAsyncJobContainer jobContainer = asyncJobService.batch();
|
|
|
+
|
|
|
+ for (int i = 0; i < 10; i++) {
|
|
|
+ jobContainer.submit(() -> sqlExecutor.insert("insert into test values('test')", null), false);
|
|
|
+ }
|
|
|
+
|
|
|
jobContainer.submit(() -> {
|
|
|
- Thread.sleep(10);
|
|
|
+ Thread.sleep(100);
|
|
|
jobContainer.cancel();
|
|
|
throw new RuntimeException();
|
|
|
}, false);
|
|
|
- for (int i = 0; i < 100; i++) {
|
|
|
- jobContainer.submit(() -> sqlExecutor.insert("insert into test values('test')", null), false);
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
System.out.println(jobContainer.getResult().size());
|
|
|
|
|
|
} catch (Exception ignore) {
|