Skip to content

Deprecate HibernateJpaSessionFactoryBean (against Hibernate 5.2) [SPR-16016] #20565

@spring-projects-issues

Description

@spring-projects-issues

Naveen Kumar opened SPR-16016 and commented

We're in the process migrating a large spring application to spring-boot and data-jpa. Almost all of the dao's use SessionFactory resource and Hibernate 4's Criteria classes.

Since it's not possible to instantly convert all those dao methods, so we decided to create a SessionFactory bean based on this reference documentation and gradually do jpa migration process.

But we end up with BeanCurrentlyInCreationException (attached the logs). Reproduced the same issue with a sample project and referred the gitlab url for that project. Until now, i have not yet come up with a workaround, so our migration process is blocked on this.

Glad to know if there is any workaround or any other ways to create SessionFactory bean.

Note: Existing application uses thread based session for transaction commits and rollbacks, so it's not feasible to use entityManager.unwrap(Session.class) as it's not thread based at all.


Affects: 4.3.11, 5.0 RC4, 5.0 GA

Reference URL: https://gitlab.com/krnaveen14/spring-orm-sessionfactorybean-bug

Attachments:

Referenced from: commits 66a6fda, bb41cce

Backported to: 4.3.12

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)status: backportedAn issue that has been backported to maintenance branchestype: taskA general task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions