Skip to content

O3-5445: Fix duplicate SQL query in AbstractBaseQueueDaoImpl#get(String uuid)#94

Open
sanks011 wants to merge 3 commits intoopenmrs:mainfrom
sanks011:O3-5445-abstract-base-queue-dao-impl-get-string-uuid-executes-duplicate-sql-query-on-every-uuid-lookup
Open

O3-5445: Fix duplicate SQL query in AbstractBaseQueueDaoImpl#get(String uuid)#94
sanks011 wants to merge 3 commits intoopenmrs:mainfrom
sanks011:O3-5445-abstract-base-queue-dao-impl-get-string-uuid-executes-duplicate-sql-query-on-every-uuid-lookup

Conversation

@sanks011
Copy link

Description

AbstractBaseQueueDaoImpl#get(String uuid) was calling criteria.add(eq("uuid", uuid)).uniqueResult() twice on the same mutable Criteria object - firing two SQL queries per UUID lookup and adding a redundant duplicate WHERE uuid = ? clause on the second query.

This affected every UUID-based entity lookup across the module (QueueEntry, Queue, QueueRoom, RoomProviderMap).

Fix removes the orphaned first call and keeps a single criteria.add(...) → uniqueResult() chain.

Related

https://openmrs.atlassian.net/jira/software/c/projects/O3/boards/37?selectedIssue=O3-5445

…ecutes-duplicate-sql-query-on-every-uuid-lookup' of https://github.com/sanks011/openmrs-module-queue into O3-5445-abstract-base-queue-dao-impl-get-string-uuid-executes-duplicate-sql-query-on-every-uuid-lookup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant