Skip to content

Commit 92828ee

Browse files
authored
BAH-4120 | Fix. Avoid opening session on existingPatient search (#135)
1 parent a6926fd commit 92828ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/src/main/java/org/bahmni/module/hip/api/dao/impl/ExistingPatientDaoImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public String getPatientUuidWithHealthId(String healthId) {
2828
String getPatientWithHealthIdQuery = "SELECT p.uuid FROM person AS p INNER JOIN \n" +
2929
"\t\t\t\t patient_identifier AS pi ON p.person_id = pi.patient_id \n" +
3030
"\t\t\t\t WHERE identifier = :healthId ;";
31-
Query query = this.sessionFactory.openSession().createSQLQuery(getPatientWithHealthIdQuery);
31+
Query query = this.sessionFactory.getCurrentSession().createSQLQuery(getPatientWithHealthIdQuery);
3232
query.setParameter("healthId", healthId);
3333
List<String> patientUuids = query.list();
3434
return patientUuids.size() > 0 ? patientUuids.get(0) : null;

0 commit comments

Comments
 (0)