AbstractRoutingDataSource fails after migrating from Hibernate 3 to 4 - spring

I have been using AbstractRoutingDataSource for a while to switch between different databases. The old configuration was Spring 3 and Hibernate 3.5.5. After upgrading Hibernate to 4.2.3, AbstractRoutingDataSource has stopped working (it always retrieves the default database).
Any help would be much appreciated.
Thank you in advance

Related

#Embeddable equivalent in cassandra 3.x or 4.x

Currently, i am doing DB Migration from SQL to NOSQL Db in spring boot application
I am looking for equivalent way of "#Embeddable" in cassandra 3.x or 4.x
Is it valid in NOSQL database, if not, please share the alternate way

Performance Issues when Upgrading OpenJPA to Hibernate

We upgraded from Open JPA -2.4.3 with Spring 4.3.19.RELEASE to Hibernate-
5.4.8.Final with Spring-5.2.6.RELEASE. We had to change ORM provider since spring 5.0 and related Spring Data did not have an OpenJPA vendor adapter. Upgrade caused Performance issues for our Batch Jobs, they were running 10 times slower than before.
We finally ended up migrating the non performing queries to Native SQL Queries.
From performance dumps it Sessions are not being released after the transaction is committed in Hibernate
Question:
Has anyone encounter similar issues and how they resolved it?
One side note, not sure whether its related or not: we have observed is OpenJPA is using OpenJpa is using WeakHashMap and Hibernate is using Concurrent Hashmap.
[1]: https://i.stack.imgur.com/4hE3V.png - Using OpenJPA
[2]: https://i.stack.imgur.com/sXRiw.png - Using Hiberate

Hibernate Tools 5.3 - Mysql 8 - domain generation

I try to generate java class from MySql 8.0.12 database by using Hibernate Tools on eclipse
Class are well generated but without annotations (like #Entity, etc...)
Here is my Hibernate Tools configuration :
I can ping database and retrieve tables :
Here is my hibernate code generation configuration :
and
I used to work with MySQL 5 and hibernate Tools 5.2 and it worked fine !
But now i would like to upgrade my database (MySql 8)
How can I solve this issue ?
it is the Hibernate version 5.3. It is a bug.
I ran into the same problem.
Change it to 5.2 and it should work.
See answer here

Migrate from Spring 2.5 Native ORM TopLink 10g to JPA

This may be annoying and discussed before but I could not find a good reference which would help to set a direction. I have to plan a migration of TopLink 10g (Spring 2.5 ORM Native Support) to JPA. I need some guidelines (steps) to follow and plan a successful migration.
Let me brief what I have in my technology stack. Primarily, as I mentioned above, application build around Spring 2.5 and Spring 2.5 Native ORM Support of TopLink. Spring 2.5 bundled to support only up to TopLink 10g and if you simply upgrade the TopLink JAR with the latest version it would not work as latest version of TopLink has completely changed the packaging but this still can be tackled by easily find and replace the package names. The main issue is the native api of TopLink ORM in Spring 2.5 which is built around TopLink 10g.
The reason of this migration activity is we cannot upgrade Spring until we migrate data-layer to JPA.
Please share steps if you already achieved something similar in your past or if the above briefing gives you an understanding on the problem you can also drop your opinion on how should I plan this migration.
I am facing a similar migration, toplink10g and Spring 2.5. For the integration we were using as support spring-toplink.jar, but not such support for toplink 12 that actually is the current version. At the moment seems it is not a straight fordward solution but I started first using the renaming tool provided by oracle.
The renaming tool it is necesary since jpa toplink 11 g is provided by eclipselink. You will see all the packages oracle.toplink.* will be renamed by org.eclipse.persistence.*
Did you have any advice othe advices for this migration?

JBOSS 5 and Spring 3 Validation Annotations

I have been trying to set up Spring 3 annotation-based validation, guided by http://static.springsource.org/spring/docs/3.0.0.RC3/spring-framework-reference/html/ch05s07.html. I am using JBOSS 5.0.1 server; however, upon invoking the #Valid annotation from the Controller. I received errors and found out it will require javax.validation.*;
Upon adding the validation-api-1.0.0.GA.jar (for javax.validation.*), I received complaints about it requiring Hibernate Validator 4+, which in turn requires Hibernate 3.5+. Finally, I discovered that JBOSS 5 does not support Hibernate 3.5+ because it uses JPA-2 and JBOSS 5 is tightly coupled to JPA-1.
At this point, my brain hurts.
Does anyone have a successful example of using Spring 3 annotation-based validation under JBOSS 5?
I finally figured out the answer to this. I basically reverted to using Hibernate Validator 3.1 using this example:
http://wheelersoftware.com/articles/hibernate-validator-3.html
Hope this helps anybody else.
I just wanted to add one more thing. I managed to wire Hibernate Validator 4.01 to JBOSS 5.01. The steps were as follows:
Remove hibernate-validator.jar from the JBOSS common/lib directory
Insert the validation-api-1.0.0.GA.jar, hibernate-validator-4.1.0.Final.jar into your project's WEB-INF/lib directory.

Resources