Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hibernate5 Module is not working with SessionFactory #103

Open
jonhkr opened this issue Feb 9, 2017 · 5 comments
Open

Hibernate5 Module is not working with SessionFactory #103

jonhkr opened this issue Feb 9, 2017 · 5 comments

Comments

@jonhkr
Copy link

jonhkr commented Feb 9, 2017

Hello,
I have a spring application that uses the Hibernate5 module, I've attached the SessionFactory to properly handle lazy initialization but I'm getting an error.

The error occurs right at this line

and this is the exception java.lang.NoSuchMethodException: org.hibernate.resource.transaction.TransactionCoordinator.isJta()

Here is how I configured the bean

    @Bean
    public Module hibernate5JacksonModule(SessionFactory factory) {
        Hibernate5Module module = new Hibernate5Module(factory);
        module.enable(Hibernate5Module.Feature.FORCE_LAZY_LOADING);
        return module;
    }

    @Bean
    public SessionFactory sessionFactory(HibernateEntityManagerFactory hemf){
        return hemf.getSessionFactory();
    }

I'm doing something wrong?

@jonhkr jonhkr changed the title Hibernate5 Module is not working wit SessionFactory Hibernate5 Module is not working with SessionFactory Feb 9, 2017
@jonhkr
Copy link
Author

jonhkr commented Feb 9, 2017

Changed to version 2.8.5 and the problem seems to be fixed.

@jonhkr
Copy link
Author

jonhkr commented Feb 9, 2017

Now I'm getting this error Illegal attempt to associate a collection with two open sessions. when Jackson tries to serialize a collection.

@jzlima
Copy link

jzlima commented Jul 31, 2017

hve u been solved this? plz help .

@markbanierink
Copy link

We encountered the Illegal attempt to associate a collection with two open sessions. error as well. Is there any solution?

@cowtowncoder
Copy link
Member

If anyone has a solution, please feel free to post it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants