flowable / flowable/flowable-engine
multi-tenant Query error: when i use latest version search in modelQuery, the error occurs.
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 9.5k
- Forks
- 2.9k
- Ø Merge
- 7 Std. 8 Min.
- Gemergte PRs (30 T.)
- 2
Beschreibung
In my saas platform, i have two tenant here.
In tenant A, i defined a process and designed the model with key 'editor',and got its version to 2。then i exported this process definition(procX)。
In tenant B, i imported this process definition(procX)。Its key is still editor, with version 1。
then this error accurs, when i get list of process models with latest versioin,i got nothing。but when i got one model list when i used no latest version。
I saw the sql printed, like this:
select *
from ACT_RE_MODEL RES
WHERE
RES.VERSION_ = (select max(VERSION_) from ACT_RE_MODEL where KEY_ = RES.KEY_)
and RES.TENANT_ID_ = ?
the problem is: there is no tenant_id in the above subquery。
Expected behavior
The query should be like this:
select *
from ACT_RE_MODEL RES
WHERE
RES.VERSION_ = (select max(VERSION_) from ACT_RE_MODEL where KEY_ = RES.KEY_ and TENANT_ID_= ?)
and RES.TENANT_ID_ = ?
BTW: i use ModelQuery to finish my job and the flowable version is 6.6。
I know navite sql may be a way to solve this problem, but i expect ModelQuery and all other Query APIs can do this well.
thanks for your good work.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne beim ModelQuery-Pfad, der den Abruf der neuesten Modellversion verarbeitet, und prüfe das im Issue gezeigte SQL. Überprüfe, ob die Versionsunterabfrage durch tenant_id eingeschränkt ist; abgeschlossen ist die Aufgabe, wenn tenant B seine importierte Version zurückgibt und dabei das erwartete Verhalten für die neueste Version jedes Tenants erhalten bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java, sql
- Bereich
- databases
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 45/100