Skip to content

Commit

Permalink
Fix metric session cache saving after batch insert when using mysql-c…
Browse files Browse the repository at this point in the history
…onnector-java.(#11009)
  • Loading branch information
weixiang1862 committed Jun 28, 2023
1 parent 4b2d1ee commit 26a96ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
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

0 comments on commit 26a96ae

Please sign in to comment.