Revert UUID contextIds

This commit is contained in:
Serge Rider
2021-12-28 14:01:41 +03:00
parent 2cfaee3af0
commit c3efd84069
@@ -64,6 +64,8 @@ public class WebSQLProcessor {
private final SQLRuleManager ruleManager;
private final Map<String, WebSQLContextInfo> contexts = new LinkedHashMap<>();
private AtomicInteger contextId = new AtomicInteger();
WebSQLProcessor(@NotNull WebSession webSession, @NotNull WebConnectionInfo connection) {
this.webSession = webSession;
this.connection = connection;
@@ -108,10 +110,10 @@ public class WebSQLProcessor {
@NotNull
public WebSQLContextInfo createContext(String defaultCatalog, String defaultSchema) throws DBCException {
UUID uuid = UUID.randomUUID();
WebSQLContextInfo contextInfo = new WebSQLContextInfo(this, uuid.toString(), defaultCatalog, defaultSchema);
String contextId = String.valueOf(this.contextId.incrementAndGet());
WebSQLContextInfo contextInfo = new WebSQLContextInfo(this, contextId, defaultCatalog, defaultSchema);
synchronized (contexts) {
contexts.put(uuid.toString(), contextInfo);
contexts.put(contextId, contextInfo);
}
return contextInfo;
}