Skip to content

Transactional behavior not being applied to method starting with setup #1013

@sdelamo

Description

@sdelamo

I have a method with signature:

void setupSessionAfterLogin(String username) {

https://github.com/grails-core-issues-forks/ssc_listener/blob/master/grails-app/services/com/nationwide/workspace/WorkspaceService.groovy#L11

Transactional behavior not being applied to that method.

If you run the functional test of master branch

https://github.com/grails-core-issues-forks/ssc_listener/

And you check the standard output you see

017-10-10 17:24:53.156 ERROR --- [o-auto-1-exec-7] .a.c.c.C.[.[.[.[grailsDispatcherServlet] : Servlet.service() for servlet [grailsDispatcherServlet] in context with path [] threw exception

org.hibernate.HibernateException: No Session found for current thread
	at org.grails.orm.hibernate.GrailsSessionContext.currentSession(GrailsSessionContext.java:117)
Thanks for reporting an issue for GORM, please review the task list below before submitting the 
issue.

Workaround:
Renaming the method signature to:

void configureSessionAfterLogin(String username) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions