Skip to content

Doc: Spring 3.x and Hibernate 4 are not compatible. Unable to use HibernateTemplate. [SPR-9365] #14002

@spring-projects-issues

Description

@spring-projects-issues

Augustine Parthinathan opened SPR-9365 and commented

While using Spring HibernateTemplate with the combination of Spring 3.1 and Hibernate 4, we are getting the following exception.

java.lang.ClassCastException: org.springframework.orm.hibernate4.SessionHolder cannot be cast to org.springframework.orm.hibernate3.SessionHolder
	at org.springframework.orm.hibernate3.SessionFactoryUtils.doGetSession(SessionFactoryUtils.java:287)
	at org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(SessionFactoryUtils.java:233)
	at org.springframework.orm.hibernate3.HibernateTemplate.getSession(HibernateTemplate.java:457)
	at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:393)
	at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
	at org.springframework.orm.hibernate3.HibernateTemplate.loadAll(HibernateTemplate.java:584)

Issue Links:

Referenced from: commits 8cf61c5, be606f4

Backported to: 3.1.4

1 votes, 3 watchers

Metadata

Metadata

Assignees

Labels

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