A @Transactional annotation for methods, like available in Spring, would reduce boilerplate code such as opening and closing the transaction manually.