Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Spring Batch - Difference In Behavior - Mysql 5.7 vs Mysql v8

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We developed a spring batch application with mysql v8. However it works perfectly fine. Note: AUTO_INCREMENT is not created in the tables by automatically. However it works perfectly fine

Now when we deployed the same application with mysql v5.7 we end up with "Duplicate "0" for key primary" error. On analysis observed it was due to something goes wrong with spring. Though same code base it doesn't work

Option#1 - Moving to Inmemory- Can someone help with a good link so that we can avoid these kind of association problems of tables integrity

Option#2 - Fix for the above issue to make it work in both mysql 8 and mysql v5.7

Please kindly advise on both the options so that it would help to decide the best one.
 
Saloon Keeper
Posts: 24825
172
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch, Daniel!

There are significant differences between MySQL Version 8 and MySQL version 5. Here are some of them: https://severalnines.com/database-blog/moving-mysql-57-mysql-80-what-you-should-know

It's almost never possible to cleanly downgrade any sort of software and you really should consider making MySQL 8 be your standard. These days it has become especially important not to get tied to old products.

If your database is small, you might consider switching to a memory-based system. H2 is popular on Spring Boot, but you can run SQLite in-memory as well as Apache Derby.

I'm working with SQLite as a disk-based database under Spring Boot right now and it has been generally good for me.
 
joseph daniel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So Can you please help me with few links where i can get good sample to implement in-memory database for lower version and get rid of all these DB issues?

Please help me which has good reference or working programs which deals with spring batch in-memory database

I'm struggling a lot with the issues now
 
Tim Holloway
Saloon Keeper
Posts: 24825
172
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use the Spring Boot initializer to create a base project for you. Just add the Spring Batch and H2 database Dependencies.

https://start.spring.io/
 
Bartender
Posts: 2129
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,
I have a question. Nowadays, companies are using big data to handle high volume of unstructured data,
will NoSQL replace relational database eventually?
 
Tim Holloway
Saloon Keeper
Posts: 24825
172
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Himai Minh wrote:Hi everyone,
I have a question. Nowadays, companies are using big data to handle high volume of unstructured data,
will NoSQL replace relational database eventually?


Well, this question really doesn't relate to the original thread topic, so it properly ought to be in its own thread.

But no. First, because there's more than one kind of NoSQL databbase. I like Neo4J because it's a database where the connections are more important than the objects - which is pretty much the reverse with SQL. MongoDB is basically a great big free-form dictionary.

Very often people will inter-link different types of databases. MongoDB is often good for online systems because joining tables in an RDBMS can be slow and expensive. But for batch processes where queries are less random in nature, the reduced data redundancy may be more important.
reply
    Bookmark Topic Watch Topic
  • New Topic