-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
5
-
None
-
None
-
None
-
None
-
None
-
None
-
None
In https://jira.mongodb.org/browse/HIBERNATE-16, we implemented basic `executeUpdate()` as following:
@Override public int executeUpdate(String mql) throws SQLException { checkClosed(); var command = parse(mql); try { mongoConnection.startTransactionIfNeeded(); return mongoClient .getDatabase(DATABASE) .runCommand(clientSession, command) .getInteger("n"); } catch (Exception e) { throw new SQLException("Failed to run #executeUpdate(String)", e); } }
It is painfully simplistic for `runCommand` is insufficient for many reasons, including:
- Retryability for non-transaction writes (exemplified in POC project)
- Exception translation
- any other things
If we use CRUD API for item #1 above, retrying mechanism has been done already; however, we need to decide whether we only support CRUD APIs for native MQL.
When implementing this, we should keep in mind that our MongoTimeoutException (((MongoOperationTimeoutException}} is its subclass), MongoExecutionTimeoutException should probably turned into SQLTimeoutException, as executeUpdate is explicitly documented to throw SQLTimeoutException.
See also
- depends on
-
HIBERNATE-16 implement java.sql.Statement
-
- Closed
-