You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2019/01/23 07:48:08 UTC

[incubator-skywalking] branch register-refactor updated: Wrong commit place.

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch register-refactor
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git


The following commit(s) were added to refs/heads/register-refactor by this push:
     new f136e8a  Wrong commit place.
f136e8a is described below

commit f136e8ac83599ca8fe80a78d534a5cfdf5e72630
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Wed Jan 23 15:47:58 2019 +0800

    Wrong commit place.
---
 .../oap/server/storage/plugin/jdbc/h2/dao/H2RegisterLockDAO.java        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2RegisterLockDAO.java b/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2RegisterLockDAO.java
index 58937df..1e3f204 100644
--- a/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2RegisterLockDAO.java
+++ b/oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/h2/dao/H2RegisterLockDAO.java
@@ -49,9 +49,9 @@ public class H2RegisterLockDAO implements IRegisterLockDAO {
                 int sequence = resultSet.getInt("sequence");
                 sequence++;
                 h2Client.execute(connection, "update " + H2RegisterLockInstaller.LOCK_TABLE_NAME + " set sequence = " + sequence + " where id = " + scope.ordinal());
+                connection.commit();
                 return sequence;
             }
-            connection.commit();
         } catch (JDBCClientException | SQLException e) {
             logger.error("try inventory register lock for scope id={} name={} failure.", scope.ordinal(), scope.name());
             logger.error("tryLock error", e);