@Override public Session executeUpdate(ServiceFactory sf, Session session, String uuid, long userId, Long sudoerId) { /* working through all readers because we want a failure exception if the session exists as read-only */ for (final P provider : read) { if (provider.findSessionIdByUuid(uuid, sf) != null) { return provider.executeUpdate(sf, session, uuid, userId, sudoerId); } } /* creating a new session */ return write.get(0).executeUpdate(sf, session, uuid, userId, sudoerId); }
@Transactional(readOnly = false) public Object doWork(org.hibernate.Session __s, ServiceFactory sf) { Principal p = validateSessionInputs(sf, req); oldsession.setDefaultEventType(p.getEventType()); long userId = executeLookupUser(sf, p); final Session s = sessionProvider.executeUpdate(sf, oldsession, internal_uuid, userId, req.sudoer); return executeSessionContextLookup(sf, p, s); }
@Transactional(readOnly = true) public Object doWork(org.hibernate.Session __s, ServiceFactory sf) { Principal p = validateSessionInputs(sf, req); oldsession.setDefaultEventType(p.getEventType()); final long userId = executeLookupUser(sf, p); // Here, we hope that the implementation has been updated // to match read-only status. Note: this code block matches // the one below, but the annotation is a compile-time rather // than run-time concern. final Session s = sessionProvider.executeUpdate(sf, oldsession, internal_uuid, userId, req.sudoer); return executeSessionContextLookup(sf, p, s); } });
@Transactional(readOnly = false) public Object doWork(org.hibernate.Session __s, ServiceFactory sf) { final Long sudoerId; if (orig.getSudoer() == null) { sudoerId = null; } else { sudoerId = orig.getSudoer().getId(); } return sessionProvider.executeUpdate(sf, copy, internal_uuid, newctx.getCurrentUserId(), sudoerId); } });