From d93e77ac942aea75bcc9e48e2eec7c37b25c11af Mon Sep 17 00:00:00 2001 From: Ainur Date: Wed, 15 May 2024 14:00:42 +0200 Subject: [PATCH] CB-5127 make instance id more readable and add port --- .../io/cloudbeaver/model/app/BaseWebApplication.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/app/BaseWebApplication.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/app/BaseWebApplication.java index 30295d47d7..3ebb0593ab 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/app/BaseWebApplication.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/app/BaseWebApplication.java @@ -35,6 +35,7 @@ import org.jkiss.dbeaver.model.auth.SMCredentialsProvider; import org.jkiss.dbeaver.model.auth.SMSessionContext; import org.jkiss.dbeaver.model.data.json.JSONUtils; +import org.jkiss.dbeaver.model.impl.app.ApplicationRegistry; import org.jkiss.dbeaver.model.rm.RMController; import org.jkiss.dbeaver.model.rm.RMProject; import org.jkiss.dbeaver.model.secret.DBSSecretController; @@ -248,8 +249,13 @@ public synchronized String getApplicationInstanceId() throws DBException { if (instanceId == null) { try { byte[] macAddress = RuntimeUtils.getLocalMacAddress(); - // workspace id from is read from property file - instanceId = BaseWorkspaceImpl.readWorkspaceIdProperty() + "_" + CommonUtils.toHexString(macAddress); + instanceId = String.join( + "_", + ApplicationRegistry.getInstance().getApplication().getId(), + BaseWorkspaceImpl.readWorkspaceIdProperty(), // workspace id is read from property file + CommonUtils.toHexString(macAddress), + CommonUtils.toString(getServerPort()) + ); } catch (Exception e) { throw new DBException("Error during generation instance id generation", e); }