mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
adapter 分批同步
This commit is contained in:
@@ -42,13 +42,13 @@ public class DBTest {
|
||||
.prepareStatement("insert into user (id,name,role_id,c_time,test1,test2) values (?,?,?,?,?,?)");
|
||||
|
||||
java.util.Date now = new java.util.Date();
|
||||
for (int i = 1; i <= 100000; i++) {
|
||||
for (int i = 1; i <= 10000; i++) {
|
||||
pstmt.clearParameters();
|
||||
pstmt.setLong(1, (long) i);
|
||||
pstmt.setString(2, "test_" + i);
|
||||
pstmt.setLong(3, (long) i % 4 + 1);
|
||||
pstmt.setDate(4, new java.sql.Date(now.getTime()));
|
||||
pstmt.setString(5, "tttt");
|
||||
pstmt.setString(5, null);
|
||||
pstmt.setBytes(6, null);
|
||||
|
||||
pstmt.execute();
|
||||
|
||||
@@ -35,7 +35,7 @@ public class OracleSyncTest {
|
||||
data.put("test1", "sdfasdfawe中国asfwef");
|
||||
dml.setData(dataList);
|
||||
|
||||
rdbAdapter.sync(dml);
|
||||
rdbAdapter.sync(Collections.singletonList(dml));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -58,7 +58,7 @@ public class OracleSyncTest {
|
||||
old.put("name", "Eric");
|
||||
dml.setOld(oldList);
|
||||
|
||||
rdbAdapter.sync(dml);
|
||||
rdbAdapter.sync(Collections.singletonList(dml));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user