Surya00011 opened a new pull request, #8332:
URL: https://github.com/apache/gravitino/pull/8332

   ### What changes were proposed in this pull request?
   ---
   - Updated `ScriptRunner.java` so that `conn.rollback()` is **not always 
called**.  
   - Rollback is now only performed when:  
     - `autoCommit` is set to `false`, **and**  
     - an exception occurs during script execution.  
   - Moved `conn.rollback()` logic from the `finally` block into the `catch` 
block.  
   - Cleaned up control flow to avoid unnecessary rollback calls after 
successful commits.  
   
   ---
   
   ### Why are the changes needed?
   ---
   Previously, `conn.rollback()` was called in the `finally` block regardless 
of connection mode.  
   
   - When `autoCommit = true`, rollback has no effect and is misleading.  
   - When a commit was already performed successfully, rollback was still 
invoked unnecessarily.  
   
   This change makes rollback behavior **cleaner and safer**, ensuring it is 
only triggered when actually required.  
   
   ---
   
   ### Does this PR introduce _any_ user-facing change?
   ---
   -  No user-facing API changes.  
   -  Internal improvement in the Hive Metastore test utility 
`ScriptRunner.java`.  
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to