You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compartment::getRoomEndpoints() sometimes skips RoomEndpoints because they are fetched lazily. Hence, they are not instances of RoomEndpoint but HibernateProxy#RoomEndpoint instead.
While adding getLazyImplementation() to unproxy and resolving this problem, I found another problem in RoomEndpoint::toApi(), which uses the executable_summary table, and there is no given RoomEndpoint yet.
(executable_summary table is updated manually using Executable::updateExecutableSummary())
// RoomEndpoint::toApi()// Determine whether room has recording service and recordings// (use executable_summary for used_room_endpoints to be taken into account)// Sometimes there is no data yet in executable_summary, so we must use the original query (see below)Object[] result = (Object[]) entityManager.createNativeQuery(
"SELECT room_has_recording_service, room_has_recordings FROM executable_summary WHERE id = :id")
.setParameter("id", getId())
.getSingleResult();
For now, as a workaround, we can either use executable_summary_view or join the tables directly:
"SELECT room_has_recording_service, room_has_recordings FROM executable_summary_view WHERE id = :id"// or"""SELECT COUNT(recording_service.id) > 0 AS room_has_recording_service, COUNT(recording_service.id) > 0 OR COUNT(resource_room_endpoint_recording_folder_ids.recording_folder_id) > 0 AS room_has_recordingsFROM used_room_endpointLEFT JOIN used_room_endpoint AS room_endpoint_usage ON room_endpoint_usage.room_endpoint_id = :idLEFT JOIN executable_service ON executable_service.executable_id = :id OR executable_service.executable_id = room_endpoint_usage.idLEFT JOIN recording_service ON recording_service.id = executable_service.idLEFT JOIN resource_room_endpoint_recording_folder_ids ON resource_room_endpoint_recording_folder_ids.resource_room_endpoint_id = :id OR resource_room_endpoint_recording_folder_ids.resource_room_endpoint_id = used_room_endpoint.room_endpoint_idWHERE used_room_endpoint.id = :id"""
The text was updated successfully, but these errors were encountered:
Puckoland
changed the title
RoomEndpoint
RoomEndpoint sometimes not in executable_summary table yet
Dec 6, 2024
Compartment::getRoomEndpoints()
sometimes skipsRoomEndpoints
because they are fetched lazily. Hence, they are not instances ofRoomEndpoint
butHibernateProxy#RoomEndpoint
instead.While adding
getLazyImplementation()
tounproxy
and resolving this problem, I found another problem inRoomEndpoint::toApi()
, which uses theexecutable_summary
table, and there is no given RoomEndpoint yet.(
executable_summary
table is updated manually usingExecutable::updateExecutableSummary()
)For now, as a workaround, we can either use
executable_summary_view
or join the tables directly:The text was updated successfully, but these errors were encountered: