DBZ-819 JdbcConnection is not thread safe
This commit is contained in:
parent
05ce2e3063
commit
2253eaa6a6
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user