DBZ-819 JdbcConnection is not thread safe

This commit is contained in:
Jiri Pechanec 2018-09-18 05:34:22 +02:00 committed by Gunnar Morling
parent 05ce2e3063
commit 2253eaa6a6

View File

@ -32,6 +32,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.debezium.annotation.NotThreadSafe;
import io.debezium.annotation.ThreadSafe;
import io.debezium.config.Configuration;
import io.debezium.config.Field;
@ -53,6 +54,7 @@
*
* @author Randall Hauch
*/
@NotThreadSafe
public class JdbcConnection implements AutoCloseable {
private static final char STATEMENT_DELIMITER = ';';
@ -1026,7 +1028,7 @@ private void cleanupPreparedStatement(PreparedStatement statement) {
private PreparedStatement createPreparedStatement(String preparedQueryString) {
return statementCache.computeIfAbsent(preparedQueryString, query -> {
try {
LOGGER.trace("Inserting prepared statement '{}' removed into the cache", query);
LOGGER.trace("Inserting prepared statement '{}' removed from the cache", query);
return connection().prepareStatement(query);
}
catch (SQLException e) {