Session vs CqlSession in CassandraTemplate compatibility in Cassandra Java driver - spring-boot

I'm trying to migrate a SpringBoot project from spring-data-cassandra 2.1.x to 3.2.x and I encountered an issue:
In 2.1.x version CassandraTemplate is created as follows new CassandraTemplate(getCassandraSession()), where getCassandraSession() returns com.datastax.driver.core.Session.
But in 3.2.x version CassandraTemplate doesn't have such a constructor. It only supports com.datastax.oss.driver.api.core.CqlSession. Is there a way to retrieve CqlSession from Session or to make it backward compatible?
Datastax version is 3.6.0.
Thank you!

Datastax upgraded its driver in January 2019 from 3.x to 4.x with no backward compatibility. Spring Data 3.x moved the latest version of the drivers a while ago indeed.
Solution is to upgrade your code to an updated version or stay stuck with Spring Data Cassandra 2.x (and Spring Boot 1.x).
To migrate your code from 3x to 4x please follow the upgrade guide and some code to help you.

Related

azure-spring-boot for springboot 2.6.3

We have recently upgraded spring boot from 2.4.3 to 2.6.3 and spring-cloud.version to "2021.0.1".
Can some one help pls here how I can find suitable azure spring dependencies which is compatible for spring 2.6.3 and spring-cloud.version to "2021.0.1.
Thanks
Dins Kumar
The compatible version can be found here https://github.com/Azure/azure-sdk-for-java/wiki/Spring-Versions-Mapping. But as #backhere mentioned, the 4.0 will be GAed in days, with many improvements and new features to make all the Spring Cloud Azure libraries more consistent.
Check this link, the spring cloud azure 4.0 version may meet your needs.
The libraries of the 4.0 GA version are not released yet, but it's in the process and will be released in a few days.
You can check with this link.

Upgrade spring data mongo db version

Can i upgrade spring data mongo version to 2.2 without upgrading the spring framework version. Currently i am using spring framework version 3.2. I need to upgrade spring data mongo db version to support mongo db 4.2 TLS support.
No, you can't. The 2.x generation of Spring Data requires Spring 5 at least. Spring Framework 3.2 is severely out of date and not maintained anymore. Spring 4 was released over 6 years ago. I can only strongly recommend to upgrade to a currently maintained version to make sure you benefit from security fixes that the 3.x generation has already not seen anymore for years.

Which version of Spring Data Release Train supports Hibernate 5.2?

I'm developing a simple web app with Spring, JPA, Hibernate, all latest versions.
I've imported hibernate-core in 5.2.4.Final as well as spring-data-jpa which version is set through the Hopper-SR5 version of spring-data-releasetrain. But the spring related dependencies are still 4.2.x !!!
And I'm facing the NoSuchMethodError: org.hibernate.Session.getFlushMode() problem related to the integration of Hibernate 5.2 into Spring which will be fixed in 4.3!
Integrate Hibernate 5.2 with Spring framework 4.x
https://jira.spring.io/browse/SPR-14334
Never noticed this page:
https://github.com/spring-projects/spring-data-commons/wiki/Release-Train-Hopper
=> Core: Upgrade Spring Framework baseline to 4.2
So basically I suppose I'm not using the correct release train version (but it's the GA!)
But next release train doesn't have anything related to Spring Framework:
https://github.com/spring-projects/spring-data-commons/wiki/Release-Train-Ingalls
and the "next next" has Spring Framework 5:
https://github.com/spring-projects/spring-data-commons/wiki/Release-Train-Kay
What am I supposed to do?
upgrade release train, to which version?
keep release train to current version, but downgrade Hibernate version?
remove release train and import each spring module one by one?
Thanks.

What's the last version of Spring Data MongoDB compatible with Spring 3.2?

I need to use WiredTiger Engine in my application which is available in the latest mongodb version 3.2.2 and my Maven repository which is using the version Spring Data MongoDB version 1.8.4, Java driver version 2.13.3 and I've installed MongoDB version 2.6.11.
Which version of spring-data-mongodb should i use, in order to be compatible with Spring 3.2.2.RELEASE?
This is the duplicate of the following unanswered question :
Which version of Spring Data MongoDB is compatible with Spring 3.2.2.RELEASE?
But I don't have enough privilege to re-ask or comment on the Question.
The last Spring Data release train compatible with Spring 3.2 is Dijkstra and has seen its last service release January 27th, 2015. The Spring Data MongoDB version contained in it is 1.5.5.RELEASE.
Note that this version is not compatible with any MongoDB 3.x version. MongoDB 3.x support was introduced in the Fowler release train and is refined in even more current releases only. So I am strongly suggesting to upgrade to one of those versions if you want to work with a MongoDB of that generation.

Spring upgradation for grails application

I have a grails web app. This uses grails-1.0.1 version. For some reason, I need to upgrade to higher version of Spring (4.2.3). Is it possible to upgrade to higher version of spring without upgrading to higher version of grails ?
Thanks,
Varun

Resources