Skip to content

Commit 160b65b

Browse files
Connection issues in server admin were fixed.
1 parent 4e2e953 commit 160b65b

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

client/src/main/java/com/orientechnologies/orient/client/remote/OServerAdmin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public OServerAdmin(String iURL) throws IOException {
5454
if (!iURL.contains("/"))
5555
iURL += "/";
5656

57-
storage = new OStorageRemote(null, iURL, "");
57+
storage = new OStorageRemote(null, iURL, "", OStorage.STATUS.OPEN);
5858
}
5959

6060
/**

client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,20 +137,27 @@ public class OStorageRemote extends OStorageAbstract implements OStorageProxy, O
137137
private final int maxReadQueue;
138138

139139
public OStorageRemote(final String iClientId, final String iURL, final String iMode) throws IOException {
140-
super(iURL, iURL, iMode, 0, new OCacheLevelTwoLocatorRemote()); // NO TIMEOUT @SINCE 1.5
141-
clientId = iClientId;
142-
configuration = null;
140+
this(iClientId, iURL, iMode, null);
141+
}
143142

144-
clientConfiguration = new OContextConfiguration();
145-
connectionRetry = clientConfiguration.getValueAsInteger(OGlobalConfiguration.NETWORK_SOCKET_RETRY);
146-
connectionRetryDelay = clientConfiguration.getValueAsInteger(OGlobalConfiguration.NETWORK_SOCKET_RETRY_DELAY);
147-
asynchEventListener = new OStorageRemoteAsynchEventListener(this);
148-
parseServerURLs();
143+
public OStorageRemote(final String iClientId, final String iURL, final String iMode, STATUS status) throws IOException {
144+
super(iURL, iURL, iMode, 0, new OCacheLevelTwoLocatorRemote()); // NO TIMEOUT @SINCE 1.5
145+
if (status != null)
146+
this.status = status;
149147

150-
asynchExecutor = Executors.newSingleThreadScheduledExecutor();
148+
clientId = iClientId;
149+
configuration = null;
151150

152-
maxReadQueue = Runtime.getRuntime().availableProcessors() - 1;
153-
}
151+
clientConfiguration = new OContextConfiguration();
152+
connectionRetry = clientConfiguration.getValueAsInteger(OGlobalConfiguration.NETWORK_SOCKET_RETRY);
153+
connectionRetryDelay = clientConfiguration.getValueAsInteger(OGlobalConfiguration.NETWORK_SOCKET_RETRY_DELAY);
154+
asynchEventListener = new OStorageRemoteAsynchEventListener(this);
155+
parseServerURLs();
156+
157+
asynchExecutor = Executors.newSingleThreadScheduledExecutor();
158+
159+
maxReadQueue = Runtime.getRuntime().availableProcessors() - 1;
160+
}
154161

155162
public int getSessionId() {
156163
return OStorageRemoteThreadLocal.INSTANCE.get().sessionId.intValue();

0 commit comments

Comments
 (0)