strongduanmu commented on code in PR #19823:
URL: https://github.com/apache/shardingsphere/pull/19823#discussion_r942305853


##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/DatabaseCommunicationEngine.java:
##########
@@ -114,24 +113,23 @@ private void prepareCursorStatementContext(final 
CursorAvailable statementContex
             prepareCursorStatementContext(statementContext, connectionSession, 
cursorName);
         }
         if (statementContext instanceof CloseStatementContext && 
((CloseStatementContext) statementContext).getSqlStatement().isCloseAll()) {
-            FetchOrderByValueGroupsHolder.remove();
-            connectionSession.getCursorDefinitions().clear();
+            connectionSession.getSqlSession().clearCursorSQLSession();
         }
     }
     
     private void prepareCursorStatementContext(final CursorAvailable 
statementContext, final ConnectionSession connectionSession, final String 
cursorName) {
         if (statementContext instanceof CursorStatementContext) {
-            connectionSession.getCursorDefinitions().put(cursorName, 
(CursorStatementContext) statementContext);
+            
connectionSession.getSqlSession().getCursorSQLSession().getCursorDefinitions().put(cursorName,
 (CursorStatementContext) statementContext);
         }
         if (statementContext instanceof CursorDefinitionAware) {
-            CursorStatementContext cursorStatementContext = 
connectionSession.getCursorDefinitions().get(cursorName);
+            CursorStatementContext cursorStatementContext = 
(CursorStatementContext) 
connectionSession.getSqlSession().getCursorSQLSession().getCursorDefinitions().get(cursorName);
             Preconditions.checkArgument(null != cursorStatementContext, 
"Cursor %s does not exist.", cursorName);
             ((CursorDefinitionAware) 
statementContext).setUpCursorDefinition(cursorStatementContext);
         }
         if (statementContext instanceof CloseStatementContext) {
-            
FetchOrderByValueGroupsHolder.getOrderByValueGroups().remove(cursorName);
-            
FetchOrderByValueGroupsHolder.getMinGroupRowCounts().remove(cursorName);
-            connectionSession.getCursorDefinitions().remove(cursorName);
+            
connectionSession.getSqlSession().getCursorSQLSession().getOrderByValueGroups().remove(cursorName);

Review Comment:
   Can we merge these method into one remove method?



-- 
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