Giter Site home page Giter Site logo

SQL errors in batch module about devon4j HOT 3 OPEN

rhobolic avatar rhobolic commented on August 16, 2024
SQL errors in batch module

from devon4j.

Comments (3)

hohwille avatar hohwille commented on August 16, 2024

@rhobolic thanks for your issue.
As you can see by the path the SQL is written for h2:
https://github.com/devonfw/devon4j/blob/master/templates/server/src/main/resources/archetype-resources/batch/src/main/resources/db/migration/h2/V0005__Add_batch_tables.sql

As we recommend(ed) to use h2 database for JUnit testing, we had written the SQL for h2.
There are tons of databases out there and it does not seem feasible to support all of them.
So to be direct I would assume your expectation is wrong here. If you change the suggestions and assumptions e.g. switching from h2 to postgresql you are also in charge of chaning the SQL accordingly.

@maihacke do you have some cents on this?`Why did we actually have to use very h2 specific SQL here if we could have done it in a DB agnostic way?
@maybeec as we are switching strategies (esp. for quarkus) to use docker for DB in JUnits, how should we proceed here?
Is it wrong in general that we started all such stuff in a framework like manner and taking responsibility of DDL for products like spring-batch that we do not own? Most probably we had to add the DDL in order to be able to insert testdata via flyway while hibernates hbm2auto-ddl auto feature can create tables for you but acts after flyway has taken action...

from devon4j.

maybeec avatar maybeec commented on August 16, 2024

@hohwille honestly saying I started to remove H2 support in most of my projects I am in and run DB on demand with docker as all my projects are at least kubenetes deployments.
That brings several advantages as I faced several workarounds in tests to run on H2.
In addition H2 isn't even faster in some cases. So if possible run tests against the target dB in a container brings a lot of advantages with sometimes depending on the DB with costs on test duration. But especially in a real continuous development project you anyhow want to test your feature branches as realistic as possible to not introduce issues you haven't seen with H2.

My voting would be to get rid of H2 by default and propose DB in a container whenever possible.

from devon4j.

maihacke avatar maihacke commented on August 16, 2024

@maihacke do you have some cents on this?`Why did we actually have to use very h2 specific SQL here if we could have done it in a DB agnostic way?

I'm not very sure, but propably it is because of the identity columns. Propably there is no hibernate orm magic here which decouples this from the database technology and spring batch just assumes that the column is handled by the DB.

@hohwille honestly saying I started to remove H2 support in most of my projects

I second this. But this has also a strong impact on CI/CD. But all in all the hassle with the containers (even in CI/CD) is better to solve than having to adopt the implementation (or tests) to different databases.

from devon4j.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.