I have a Sprint Boot project with open session in view. When I try to sort a list like this
<th:block th:each="e : ${#lists.sort(entity.getElements(), new com.example.CustomerComparator())}"
th:include="fragments/table-row::row(elem = ${e})">
</th:block>
I get a LazyInitializationException
Reason is that Thymeleaf
Workaround: Wrap the list in a normal list