diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLProcessor.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLProcessor.java index df4835bb5d9..47c8b90bcc9 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLProcessor.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLProcessor.java @@ -1,6 +1,6 @@ /* * DBeaver - Universal Database Manager - * Copyright (C) 2010-2025 DBeaver Corp and others + * Copyright (C) 2010-2026 DBeaver Corp and others * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,6 +35,8 @@ import org.jkiss.dbeaver.model.DBPDataKind; import org.jkiss.dbeaver.model.DBPDataSource; import org.jkiss.dbeaver.model.DBUtils; +import org.jkiss.dbeaver.model.connection.DBPDriver; +import org.jkiss.dbeaver.model.connection.DBPDriverConstants; import org.jkiss.dbeaver.model.data.*; import org.jkiss.dbeaver.model.edit.DBEPersistAction; import org.jkiss.dbeaver.model.exec.*; @@ -415,13 +417,17 @@ public WebSQLExecuteInfo updateResultsDataBatch( monitor, resultsInfo, rowIdentifier, updatedRows, deletedRows, addedRows, resultBatches, keyReceiver); DBCExecutionContext executionContext = getExecutionContext(dataManipulator); + DBPDriver driver = executionContext.getDataSource().getContainer().getDriver(); + boolean skipAutoCommitToggle = CommonUtils.toBoolean( + driver.getDriverParameter(DBPDriverConstants.PARAM_NATIVE_BATCH_AUTO_COMMIT) + ); try (DBCSession session = executionContext.openSession(monitor, DBCExecutionPurpose.USER, "Update data in container")) { DBCTransactionManager txnManager = DBUtils.getTransactionManager(executionContext); boolean revertToAutoCommit = false; DBCSavepoint savepoint = null; if (txnManager != null) { isAutoCommitEnabled = txnManager.isAutoCommit(); - if (txnManager.isSupportsTransactions() && isAutoCommitEnabled) { + if (txnManager.isSupportsTransactions() && isAutoCommitEnabled && !skipAutoCommitToggle) { txnManager.setAutoCommit(monitor, false); revertToAutoCommit = true; } @@ -447,11 +453,13 @@ public WebSQLExecuteInfo updateResultsDataBatch( newResultSetRows.add(new WebSQLQueryResultSetRow(rowValues, null)); } - if (txnManager != null && txnManager.isSupportsTransactions() && isAutoCommitEnabled) { + if (txnManager != null && txnManager.isSupportsTransactions() && + isAutoCommitEnabled && !skipAutoCommitToggle + ) { txnManager.commit(session); } } catch (Exception e) { - if (txnManager != null && txnManager.isSupportsTransactions()) { + if (txnManager != null && txnManager.isSupportsTransactions() && !skipAutoCommitToggle) { txnManager.rollback(session, savepoint); } throw new DBCException("Error persisting data changes", e);