1
votes

No such property: transactionStatus for class: org.siti.TicketController.

The error occurs here:

if (ticket.hasErrors()) {
        transactionStatus.setRollbackOnly()
        respond ticket.errors, view:'edit'
        return
    }

but the controller imports import grails.transaction.Transactional and the controller is annotated with @Transactional(readOnly = true) grails version 3.2.4

1
I can't reproduce that. Please file an issue at github.com/grails/grails-core/issues and provide a sample app which demonstrates the problem and we can take a look. Thanks for the feedback! - Jeff Scott Brown
Did you annotate the method (not the controller) with @Transactional ? By the way, importing Transactional is not transactionStatus. It is hard to help you out if you only showed a snippet of code. We need to see the method definition and even the controller one. - nbkhope
Hi Jeff, I'm sorry, but in a newly created demo application, I cannot reproduce that. In original application I try to save Date having wrong format, but have no validation message on the view, because the controller throws the No such property: transactionStatus for class error first. - user2018054
@nbkhope "By the way, importing Transactional is not transactionStatus." - The original question indicates that he not only imported the annotation but also says that the controller is annotated with @Transactional. That should cause the transactionStatus property to be added to the class at compile time. - Jeff Scott Brown

1 Answers

0
votes

Try getting rid og the readOnly=true and just go with plain @Transactional. If it is read only, what are you rolling back?