You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/06/15 07:57:15 UTC

[GitHub] [shardingsphere] terrymanu commented on a diff in pull request #18359: Fix begin for postgresql & opengauss

terrymanu commented on code in PR #18359:
URL: https://github.com/apache/shardingsphere/pull/18359#discussion_r897655261


##########
shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/command/CommandExecutorTask.java:
##########
@@ -114,7 +115,10 @@ private boolean executeCommand(final ChannelHandlerContext context, final Packet
             }
             return true;
         } catch (final SQLException ex) {
-            databaseProtocolFrontendEngine.handleException(connectionSession);
+            databaseProtocolFrontendEngine.handleException(connectionSession, ex);
+            throw ex;
+        } catch (final BackendException ex) {
+            databaseProtocolFrontendEngine.handleException(connectionSession, ex);

Review Comment:
   It is better to use `|` for multiple exception process



##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/exception/InTransactionException.java:
##########
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.proxy.backend.exception;
+
+import lombok.Getter;
+
+/**
+ * In transaction exception.
+ */
+@Getter
+public final class InTransactionException extends BackendException {

Review Comment:
   Please use @RequiredArgsConstructor



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org