Zum Inhalt springen

Read Not Marked Read-Only (ARCH8054)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Key kotlin.orm.read-not-marked-readonly · Severity warning · Category orm

Flags find / get / list methods in a @Transactional class that do not set readOnly = true - the persistence context tracks every loaded entity for nothing.

@Transactional
fun listOrders(): List<Order> = repo.findAll()
@Transactional(readOnly = true)
fun listOrders(): List<Order> = repo.findAll()

Mark read paths @Transactional(readOnly = true).