When Batch#execute encounters a connection where a prepared statement has not been prepared it handles this by retrying, but there's nothing that says that it will get a connection where the statement has been prepared on the next try. Instead it should do something like what PreparedStatement#execute does and make sure that the statement is prepared on the chosen connection.
When
Batch#execute
encounters a connection where a prepared statement has not been prepared it handles this by retrying, but there's nothing that says that it will get a connection where the statement has been prepared on the next try. Instead it should do something like whatPreparedStatement#execute
does and make sure that the statement is prepared on the chosen connection.