Commit 3ec368dc authored by Kostis Trantzas's avatar Kostis Trantzas
Browse files

Merge branch '100-connection-leak-in-servicereposervice-getserviceeager' into 'develop'

fix for #100

See merge request !100
parents 654b0d05 fab1f8a7
Loading
Loading
Loading
Loading
Loading
+15 −23
Original line number Diff line number Diff line
@@ -882,12 +882,10 @@ public class ServiceRepoService {
		if (id == null || id.equals("")) {
			return null;
		}
		Service s = null;
		try (Session session = sessionFactory.openSession()) {
	        Transaction tx = session.beginTransaction();
			s = (Service) session.get(Service.class, id);

		Service s = this.findByUuid(id);
		if (s == null) {
				return this.findByUuid(id);// last resort
			return null;
		}

		Hibernate.initialize(s.getRelatedParty());
@@ -900,12 +898,6 @@ public class ServiceRepoService {
		Hibernate.initialize(s.getSupportingResource());
		Hibernate.initialize(s.getPlace());

			tx.commit();
		} catch (Exception e) {
	        e.printStackTrace();
	      }

		
		return s;
	}