Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix metric session cache saving when using mysql-connector-java.(#11009) #11012

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/en/changes/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* Packages with name `recevier` are renamed to `receiver`.
* `BanyanDBMetricsDAO` handles `storeIDTag` in `multiGet` for `BanyanDBModelExtension`.
* Fix endpoint grouping-related logic and enhance the performance of PatternTree retrieval.
* Fix metric session cache saving after batch insert when using `mysql-connector-java`

#### UI

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.apache.skywalking.oap.server.storage.plugin.jdbc;

import java.sql.Statement;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.skywalking.oap.server.core.UnexpectedException;
Expand Down Expand Up @@ -84,7 +85,7 @@ private void executeBatch(PreparedStatement preparedStatement,
final var executeBatchResults = preparedStatement.executeBatch();
final var isInsert = bulkRequest.get(0) instanceof InsertRequest;
for (int i = 0; i < executeBatchResults.length; i++) {
if (executeBatchResults[i] == 1 && isInsert) {
if ((executeBatchResults[i] == 1 || executeBatchResults[i] == Statement.SUCCESS_NO_INFO) && isInsert) {
// Insert successfully.
((InsertRequest) bulkRequest.get(i)).onInsertCompleted();
} else if (executeBatchResults[i] == 0 && !isInsert) {
Expand Down
Loading