This is an automated email from the ASF dual-hosted git repository.
yuqi4733 pushed a commit to branch branch-1.1
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/branch-1.1 by this push:
new 9d3d9d4a27 [Minor]: fix(core): change session handling to
doWithoutCommit for soft delete operations (#9469)
9d3d9d4a27 is described below
commit 9d3d9d4a271b71fc1490a176db2a8a02c7548fd1
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Dec 12 14:15:08 2025 +0800
[Minor]: fix(core): change session handling to doWithoutCommit for soft
delete operations (#9469)
### What changes were proposed in this pull request?
Replace `doWithCommit` with `doWithoutCommit` in
`TableMetaService#deleteTable`
### Why are the changes needed?
We should not use `doWithCommit` within `doMultipleWithCommit`, or it
can't be rollbacked when someting unexpected happens.
### Does this PR introduce _any_ user-facing change?
N/A.
### How was this patch tested?
Existing tests.
Co-authored-by: Mini Yu <[email protected]>
---
.../gravitino/storage/relational/service/MetalakeMetaService.java | 4 ++--
.../gravitino/storage/relational/service/TableMetaService.java | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git
a/core/src/main/java/org/apache/gravitino/storage/relational/service/MetalakeMetaService.java
b/core/src/main/java/org/apache/gravitino/storage/relational/service/MetalakeMetaService.java
index 9e10410e2d..14838bbca1 100644
---
a/core/src/main/java/org/apache/gravitino/storage/relational/service/MetalakeMetaService.java
+++
b/core/src/main/java/org/apache/gravitino/storage/relational/service/MetalakeMetaService.java
@@ -372,12 +372,12 @@ public class MetalakeMetaService {
SessionUtils.doMultipleWithCommit(
() ->
metalakeDeleteCount[0] =
- SessionUtils.doWithCommitAndFetchResult(
+ SessionUtils.getWithoutCommit(
MetalakeMetaMapper.class,
mapper ->
mapper.deleteMetalakeMetasByLegacyTimeline(legacyTimeline, limit)),
() ->
ownerRelDeleteCount[0] =
- SessionUtils.doWithCommitAndFetchResult(
+ SessionUtils.getWithoutCommit(
OwnerMetaMapper.class,
mapper ->
mapper.deleteOwnerMetasByLegacyTimeline(legacyTimeline, limit)));
return metalakeDeleteCount[0] + ownerRelDeleteCount[0];
diff --git
a/core/src/main/java/org/apache/gravitino/storage/relational/service/TableMetaService.java
b/core/src/main/java/org/apache/gravitino/storage/relational/service/TableMetaService.java
index 092263a990..7c67cfe460 100644
---
a/core/src/main/java/org/apache/gravitino/storage/relational/service/TableMetaService.java
+++
b/core/src/main/java/org/apache/gravitino/storage/relational/service/TableMetaService.java
@@ -137,7 +137,7 @@ public class TableMetaService {
}
}),
() ->
- SessionUtils.doWithCommit(
+ SessionUtils.doWithoutCommit(
TableVersionMapper.class,
mapper -> {
if (overwrite) {
@@ -211,7 +211,7 @@ public class TableMetaService {
TableMetaMapper.class,
mapper -> mapper.updateTableMeta(newTablePO, oldTablePO,
newSchemaId))),
() ->
- SessionUtils.doWithCommit(
+ SessionUtils.doWithoutCommit(
TableVersionMapper.class,
mapper -> {
mapper.softDeleteTableVersionByTableIdAndVersion(
@@ -289,7 +289,7 @@ public class TableMetaService {
mapper ->
mapper.softDeletePolicyMetadataObjectRelsByTableId(
namespacedEntityId.entityId()));
- SessionUtils.doWithCommit(
+ SessionUtils.doWithoutCommit(
TableVersionMapper.class,
mapper ->
mapper.softDeleteTableVersionByTableIdAndVersion(