mirror of
https://gitee.com/dromara/dbswitch.git
synced 2026-01-13 06:04:44 +08:00
修正代码错误
This commit is contained in:
@@ -25,7 +25,6 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.TransactionException;
|
||||
import org.springframework.transaction.TransactionStatus;
|
||||
|
||||
/**
|
||||
@@ -119,14 +118,13 @@ public class DefaultTableDataSynchronizeProvider
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
tx.commit(status);
|
||||
return records.size();
|
||||
} catch (TransactionException e) {
|
||||
tx.rollback(status);
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
tx.rollback(status);
|
||||
throw e;
|
||||
@@ -173,14 +171,13 @@ public class DefaultTableDataSynchronizeProvider
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
tx.commit(status);
|
||||
return dataLists.size();
|
||||
} catch (TransactionException e) {
|
||||
tx.rollback(status);
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
tx.rollback(status);
|
||||
throw e;
|
||||
@@ -209,9 +206,6 @@ public class DefaultTableDataSynchronizeProvider
|
||||
jdbcTemplate.batchUpdate(this.deleteStatementSql, dataLists, this.deleteArgsType);
|
||||
tx.commit(status);
|
||||
return dataLists.size();
|
||||
} catch (TransactionException e) {
|
||||
tx.rollback(status);
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
tx.rollback(status);
|
||||
throw e;
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
package com.gitee.dbswitch.provider.write;
|
||||
|
||||
import com.gitee.dbswitch.common.type.ProductTypeEnum;
|
||||
import com.gitee.dbswitch.common.util.ObjectCastUtils;
|
||||
import com.gitee.dbswitch.provider.AbstractCommonProvider;
|
||||
import com.gitee.dbswitch.provider.ProductFactoryProvider;
|
||||
import java.util.Collections;
|
||||
@@ -21,7 +20,6 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.TransactionException;
|
||||
import org.springframework.transaction.TransactionStatus;
|
||||
|
||||
@Slf4j
|
||||
@@ -86,9 +84,6 @@ public class DefaultTableDataWriteProvider
|
||||
log.debug("{} insert data affect count: {}", getProductType(), affectCount);
|
||||
}
|
||||
return affectCount;
|
||||
} catch (TransactionException e) {
|
||||
tx.rollback(status);
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
tx.rollback(status);
|
||||
throw e;
|
||||
|
||||
@@ -43,7 +43,8 @@ public class WriterTaskThread extends TaskProcessor<WriterTaskResult> {
|
||||
|
||||
try {
|
||||
BatchElement elem;
|
||||
while ((elem = memChannel.poll()) != null || robotReader.getRemainingCount() > 0) {
|
||||
while (!memChannel.isEmpty() || robotReader.getRemainingCount() > 0) {
|
||||
elem = memChannel.poll();
|
||||
if (Thread.currentThread().isInterrupted()) {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user