Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WFLY-19790] Remove batch-processing DS file #960

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions batch-processing/add-h2-ds.cli
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
xa-data-source add --name=batch_db --enabled=true --use-java-context=true --use-ccm=true --jndi-name=java:jboss/datasources/batch-processingDS --xa-datasource-properties={"URL"=>"jdbc:h2:mem:batch-processing;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1"} --driver-name=h2 --password=sa --user-name=sa --same-rm-override=false --no-recovery=true
Copy link
Contributor

@emmartins emmartins Oct 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think you could do this op using only Jakarta specs, which would make this app portable among vendors. But I tried to use a DataSourceDefinition like the one below (you can add this for instance to Contact class) but first Glow complained and required me to prevent fail on error, and then boot failed with a CNFE for org.h2.jdbcx.JdbcDataSource. I guess we can try to explore the specs way and clarify how should users use the specs DataSourceDefinition later...

@DataSourceDefinition(name="java:jboss/datasources/batch-processingDS",
className="org.h2.jdbcx.JdbcDataSource",
url="jdbc:h2:mem:batch-processing;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1",
user="sa",
password="sa"
)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nevermind, I was able to make it work, I will send an alternative PR for you to have a look

68 changes: 55 additions & 13 deletions batch-processing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
<!-- the versions for BOMs, Packs and Plugins -->
<version.bom.ee>${version.server}</version.bom.ee>
<version.plugin.wildfly>5.0.0.Final</version.plugin.wildfly>
<server.test.feature.pack.artifactId>wildfly-ee-galleon-pack</server.test.feature.pack.artifactId>
<server.test.feature.pack.groupId>org.wildfly</server.test.feature.pack.groupId>
<configure.ds.script>${project.basedir}/add-h2-ds.cli</configure.ds.script>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -200,12 +203,32 @@
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<configuration>
<discover-provisioning-info>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we going back to directly using galleon layers, instead of glow's discovery? This seems a mistake

Copy link
Contributor

@emmartins emmartins Oct 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you are just doing copy paste of outdated (in the sense of not using glow) configuration? You can use glow and pack a script. In short the only change you do here is to add

                            <packaging-scripts>
                                <packaging-script>
                                    <scripts>
                                        <script>${configure.ds.script}</script>
                                    </scripts>
                                    <!-- Expressions resolved during server execution -->
                                    <resolve-expressions>false</resolve-expressions>
                                </packaging-script>
                            </packaging-scripts>

<version>${version.server}</version>
<addOns>
<addOn>h2-database:default</addOn>
</addOns>
</discover-provisioning-info>
<feature-packs>
<feature-pack>
<groupId>${server.test.feature.pack.groupId}</groupId>
<artifactId>${server.test.feature.pack.artifactId}</artifactId>
<version>${version.server}</version>
</feature-pack>
<feature-pack>
<location>org.wildfly:wildfly-datasources-galleon-pack:8.0.1.Final</location>
</feature-pack>
</feature-packs>
<layers>
<layer>core-tools</layer>
<layer>batch-jberet</layer>
<layer>h2-driver</layer>
<layer>jaxrs-server</layer>
<layer>jsf</layer>
</layers>
<packaging-scripts>
<packaging-script>
<scripts>
<script>${configure.ds.script}</script>
</scripts>
<!-- Expressions resolved during server execution -->
<resolve-expressions>false</resolve-expressions>
</packaging-script>
</packaging-scripts>
<!--
Rename the output war to ROOT.war before adding it to the server, so that the
application is deployed in the root web context.
Expand All @@ -231,13 +254,32 @@
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<configuration>
<discover-provisioning-info>
<version>${version.server}</version>
<context>cloud</context>
<addOns>
<addOn>h2-database:default</addOn>
</addOns>
</discover-provisioning-info>
<feature-packs>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should revert this change too, other than adding the script of course

<feature-pack>
<groupId>${server.test.feature.pack.groupId}</groupId>
<artifactId>${server.test.feature.pack.artifactId}</artifactId>
<version>${version.server}</version>
</feature-pack>
<feature-pack>
<location>org.wildfly:wildfly-datasources-galleon-pack:8.0.1.Final</location>
</feature-pack>
</feature-packs>
<layers>
<layer>core-tools</layer>
<layer>batch-jberet</layer>
<layer>h2-driver</layer>
<layer>jaxrs-server</layer>
<layer>jsf</layer>
</layers>
<packaging-scripts>
<packaging-script>
<scripts>
<script>${configure.ds.script}</script>
</scripts>
<!-- Expressions resolved during server execution -->
<resolve-expressions>false</resolve-expressions>
</packaging-script>
</packaging-scripts>
<!--
The parent POM's 'openshift' profile renames the output archive to ROOT.war so that the
application is deployed in the root web context. Add ROOT.war to the server.
Expand Down

This file was deleted.

Loading