提交 f3491a9d 编写于 作者: S serge-rider

#5073 Multiple DBeaver instances checking (lock workspace)

上级 45998281
......@@ -55,7 +55,6 @@ import org.osgi.framework.BundleEvent;
import org.osgi.framework.BundleListener;
import java.io.*;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Properties;
......@@ -122,6 +121,21 @@ public class DBeaverApplication implements IApplication, DBPApplication {
return IApplication.EXIT_OK;
}
}
// Lock the workspace
try {
// Check for locked workspace
if (instanceLoc.isLocked()) {
if (!setDefaultWorkspacePath(instanceLoc)) {
return IApplication.EXIT_OK;
}
}
// Lock the workspace
if (!instanceLoc.isLocked()) {
instanceLoc.lock();
}
} catch (Exception e) {
e.printStackTrace();
}
// Create display
getDisplay();
......@@ -287,7 +301,7 @@ public class DBeaverApplication implements IApplication, DBPApplication {
defaultHomePath);
boolean keepTrying = true;
while (keepTrying) {
if (!instanceLoc.set(defaultHomeURL, true)) {
if (instanceLoc.isLocked() || !instanceLoc.set(defaultHomeURL, true)) {
if (reuseWorkspace) {
instanceLoc.set(defaultHomeURL, false);
keepTrying = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册