You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@submarine.apache.org by GitBox <gi...@apache.org> on 2021/10/23 04:06:27 UTC

[GitHub] [submarine] KUAN-HSUN-LI opened a new pull request #785: SUBMARINE-1059. Setup hibernate

KUAN-HSUN-LI opened a new pull request #785:
URL: https://github.com/apache/submarine/pull/785


   ### What is this PR for?
   * Using an ORM  based database
   Goal:
   * Provide the transaction SQL operation allowing rollback when the operations get wrong.
   
   ### What type of PR is it?
   [Improvement | Feature]
   
   ### Todos
   
   ### What is the Jira issue?
   https://issues.apache.org/jira/browse/SUBMARINE-1059
   
   ### How should this be tested?
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * Do the license files need updating? No
   * Are there breaking changes for older versions? Yes
   * Does this need new documentation? No
   


-- 
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: commits-unsubscribe@submarine.apache.org

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



[GitHub] [submarine] pingsutw commented on a change in pull request #785: SUBMARINE-1059. Setup hibernate

Posted by GitBox <gi...@apache.org>.
pingsutw commented on a change in pull request #785:
URL: https://github.com/apache/submarine/pull/785#discussion_r735155905



##########
File path: submarine-server/server-core/src/main/java/org/apache/submarine/server/database/utils/HibernateUtil.java
##########
@@ -0,0 +1,57 @@
+/*
+ * 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.submarine.server.database.utils;
+
+
+import org.apache.submarine.commons.runtime.exception.SubmarineRuntimeException;
+import org.hibernate.SessionFactory;
+import org.hibernate.boot.MetadataSources;
+import org.hibernate.boot.registry.StandardServiceRegistry;
+import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class HibernateUtil {
+  private static final Logger LOG = LoggerFactory.getLogger(HibernateUtil.class);
+
+  private static final SessionFactory sessionFactory = buildSessionFactory();
+
+  public static void close() {
+    System.out.println("session " + sessionFactory);

Review comment:
       should Use `Log.info` or remove it?




-- 
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: commits-unsubscribe@submarine.apache.org

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



[GitHub] [submarine] FatalLin commented on a change in pull request #785: SUBMARINE-1059. Setup hibernate

Posted by GitBox <gi...@apache.org>.
FatalLin commented on a change in pull request #785:
URL: https://github.com/apache/submarine/pull/785#discussion_r736242610



##########
File path: pom.xml
##########
@@ -306,6 +309,17 @@
         <artifactId>snakeyaml</artifactId>
         <version>${snakeyaml.version}</version>
       </dependency>
+      <!--  Submarine Server  -->
+      <dependency>
+        <groupId>org.jboss.logging</groupId>
+        <artifactId>jboss-logging</artifactId>

Review comment:
       I see, let's try to exclude it first.




-- 
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: commits-unsubscribe@submarine.apache.org

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



[GitHub] [submarine] asfgit closed pull request #785: SUBMARINE-1059. Setup hibernate

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #785:
URL: https://github.com/apache/submarine/pull/785


   


-- 
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: commits-unsubscribe@submarine.apache.org

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



[GitHub] [submarine] FatalLin commented on a change in pull request #785: SUBMARINE-1059. Setup hibernate

Posted by GitBox <gi...@apache.org>.
FatalLin commented on a change in pull request #785:
URL: https://github.com/apache/submarine/pull/785#discussion_r736179127



##########
File path: pom.xml
##########
@@ -306,6 +309,17 @@
         <artifactId>snakeyaml</artifactId>
         <version>${snakeyaml.version}</version>
       </dependency>
+      <!--  Submarine Server  -->
+      <dependency>
+        <groupId>org.jboss.logging</groupId>
+        <artifactId>jboss-logging</artifactId>

Review comment:
       Just wondering why we need jboss-logging package here?
   loos like it's a logging utility for jboss container but we use jetty for now.
   




-- 
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: commits-unsubscribe@submarine.apache.org

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



[GitHub] [submarine] KUAN-HSUN-LI commented on a change in pull request #785: SUBMARINE-1059. Setup hibernate

Posted by GitBox <gi...@apache.org>.
KUAN-HSUN-LI commented on a change in pull request #785:
URL: https://github.com/apache/submarine/pull/785#discussion_r736238019



##########
File path: pom.xml
##########
@@ -306,6 +309,17 @@
         <artifactId>snakeyaml</artifactId>
         <version>${snakeyaml.version}</version>
       </dependency>
+      <!--  Submarine Server  -->
+      <dependency>
+        <groupId>org.jboss.logging</groupId>
+        <artifactId>jboss-logging</artifactId>

Review comment:
       `jboss-logging` is a dependency of `hibernate` but it has a dependency conflict inside its project. Maybe I should exclude this dependency.
   ![image](https://user-images.githubusercontent.com/38066413/138830969-f690f216-b792-444e-98eb-4322c5b2b437.png)
   




-- 
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: commits-unsubscribe@submarine.apache.org

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