Announcement Announcement Module
Collapse
No announcement yet.
ActiveRecord with @Transactional method : no automatic flush ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ActiveRecord with @Transactional method : no automatic flush ?

    Hello,

    I'm using spring Roo and it is working quite well !
    However, I got a problem with a method that I added to my entity(in the .java file, not the .aj). This method is annotated with @Transactional and is doing some modification on the entity.
    When I call this method from a controller on a managed entity (just loaded with a finder), the flush is not done, I have to call manually the flush after the entity method call :
    Code:
    entity.businessMethod(param1, param2);
    entity.flush();
    If I don't flush, no modification recorded in the database.

    Am I doing something wrong ?

    I didn't change the setup provided by roo (hibernate, mvc and OpenEntityManagerInViewFilter).

    Thanks for you help !
Working...
X