Transaction trans = null;
Session sess = null;
if (homeCommunityId != null && !homeCommunityId.isEmpty() && assigningAuthority != null
&& !assigningAuthority.isEmpty()) {
SessionFactory fact = getSessionFactory();
<BUG>try {
sess = fact.openSession();
if (sess != null) {</BUG>
Query namedQuery = sess.getNamedQuery("findAAByAAIdAndHomeCommunityId");
namedQuery.setParameter("assigningAuthorityId", assigningAuthority);

Transaction trans = null;
Session sess = null;
if (homeCommunityId != null && !homeCommunityId.isEmpty() && assigningAuthority != null
&& !assigningAuthority.isEmpty()) {
SessionFactory fact = getSessionFactory();
try {
if (fact != null) {
sess = fact.openSession();
Query namedQuery = sess.getNamedQuery("findAAByAAIdAndHomeCommunityId");
namedQuery.setParameter("assigningAuthorityId", assigningAuthority);
