File tree Expand file tree Collapse file tree 6 files changed +75
-27
lines changed
util/internal/integrationtest/jbatch-runtime Expand file tree Collapse file tree 6 files changed +75
-27
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,6 @@ updates:
53
53
- " com.puppycrawl.tools:*"
54
54
# DB drivers:
55
55
- " com.h2database:h2"
56
- - " org.apache.derby:derby"
57
56
- " org.postgresql:postgresql"
58
57
- " org.mariadb.jdbc:mariadb-java-client"
59
58
- " com.mysql:mysql-connector-j"
@@ -111,10 +110,6 @@ updates:
111
110
# we don't want always want to get the latest Weld version:
112
111
- dependency-name : " org.jboss.weld.se:*"
113
112
update-types : ["version-update:semver-major"]
114
- # Sticking to Derby 10.16 for now since later versions require JDK 21+, and we need to test with JDK 17.
115
- # See https://db.apache.org/derby/derby_downloads.html
116
- - dependency-name : " org.apache.derby:*"
117
- update-types : [ "version-update:semver-major", "version-update:semver-minor" ]
118
113
# Sticking to SLF4J 1.x for now since later versions require to upgrade providers
119
114
# (Log4j, ... see https://www.slf4j.org/faq.html#changesInVersion200),
120
115
# and also because we only need this dependency for AWS SDK,
Original file line number Diff line number Diff line change 158
158
159
159
<!-- >>> JDBC Drivers -->
160
160
<version .com.h2database>2.3.232</version .com.h2database>
161
- <!-- Sticking to Derby 10.16 for now since later versions require JDK 21+, and we need to test with JDK 17.
162
- See https://db.apache.org/derby/derby_downloads.html -->
163
- <version .org.apache.derby>10.16.1.1</version .org.apache.derby>
164
161
<version .org.postgresql>42.7.7</version .org.postgresql>
165
162
<version .org.mariadb.jdbc>3.5.3</version .org.mariadb.jdbc>
166
163
<version .mysql.mysql-connector-j>9.3.0</version .mysql.mysql-connector-j>
879
876
<artifactId >h2</artifactId >
880
877
<version >${version.com.h2database} </version >
881
878
</dependency >
882
- <dependency >
883
- <groupId >org.apache.derby</groupId >
884
- <artifactId >derby</artifactId >
885
- <version >${version.org.apache.derby} </version >
886
- </dependency >
887
879
<dependency >
888
880
<groupId >org.postgresql</groupId >
889
881
<artifactId >postgresql</artifactId >
Original file line number Diff line number Diff line change 209
209
<!-- The lowest supported version of Java for applications using Hibernate Search -->
210
210
<!-- Set statically, independently from the current JDK: we want our code to comply with this version -->
211
211
<!-- Adjust the contributing guide when changing the release Java version -->
212
- <!-- Once upgrading review the dependency list to see if any major versions can be updated e.g. Derby 10.17 requires JDK 21 (see dependabot config and comments in POMs). -->
213
212
<java-version .main.release>17</java-version .main.release>
214
213
<java-version .main.compiler.java_home>${java.home} </java-version .main.compiler.java_home>
215
214
<java-version .main.compiler>${java-version.main.compiler.java_home} /bin/javac</java-version .main.compiler>
Original file line number Diff line number Diff line change 35
35
<scope >compile</scope >
36
36
</dependency >
37
37
<!--
38
- JBatch requires a database in order to work, and it seems it uses SQL that won't work with H2.
39
- Anyway, it uses an embedded Derby instance by default, so we just put the Derby driver in the classpath
40
- so it won't complain .
38
+ JBatch requires a database in order to work. Since we either need to use an embedded Derby or create the schema,
39
+ we want to keep the setup to a minimum and use only H2.
40
+ Derby is not used to keep the # of managed dependencies lower .
41
41
-->
42
42
<dependency >
43
- <groupId >org.apache.derby </groupId >
44
- <artifactId >derby </artifactId >
45
- <version >${version.org.apache.derby } </version >
43
+ <groupId >com.h2database </groupId >
44
+ <artifactId >h2 </artifactId >
45
+ <version >${version.com.h2database } </version >
46
46
<scope >compile</scope >
47
47
</dependency >
48
48
</dependencies >
Original file line number Diff line number Diff line change 1
1
# SPDX-License-Identifier: Apache-2.0
2
2
# Copyright Red Hat Inc. and Hibernate Authors
3
3
4
- # Let JBatch use an embedded Derby database (the default),
5
- # since the SQL it generates doesn't seem to work on other DBs (H2 in particular)
4
+ # Configure h2 in-memory database to be used with JBatch,
5
+ # It requires the user and password to be passed via the following properties.
6
+ # See com.ibm.jbatch.container.util.BatchContainerConstants for other property constants:
7
+ DB_USER =sa
8
+ DB_PWD =sa
6
9
7
- # However, we still customize the database location
8
- # (the default uses a "RUNTIMEDB" directory in the current working directory)
9
- JDBC_URL =jdbc:derby:memory:jbatch;create=true
10
+ # Since we are not relying on the embedded Derby instance, we have to manually create the schema.
11
+ # To do that, the init script is included in the JDBC url.
12
+ # Schema scripts are adapted from the built-in Derby ones located in com.ibm.jbatch.container.services.impl.JDBCPersistenceManagerSQLConstants
13
+ # H2 Database Configuration
14
+ JDBC_URL =jdbc:h2:mem:db1;INIT=RUNSCRIPT FROM 'classpath:/h2-batch-schema.sql';DB_CLOSE_DELAY=-1
10
15
# Need to explicitly specify the driver class since the default ones points to `org.apache.derby.jdbc.EmbeddedDriver`
11
- # which is not there anymore since Derby 10.15
12
- JDBC_DRIVER =org.apache.derby.iapi.jdbc.AutoloadedDriver
16
+ JDBC_DRIVER =org.h2.Driver
Original file line number Diff line number Diff line change
1
+ CREATE SCHEMA IF NOT EXISTS JBATCH;
2
+ SET SCHEMA JBATCH;
3
+ CREATE TABLE IF NOT EXISTS JOBINSTANCEDATA
4
+ (
5
+ jobinstanceid BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1 ) PRIMARY KEY ,
6
+ name VARCHAR (512 ),
7
+ apptag VARCHAR (512 )
8
+ );
9
+ CREATE TABLE IF NOT EXISTS EXECUTIONINSTANCEDATA
10
+ (
11
+ jobexecid BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1 ) PRIMARY KEY ,
12
+ jobinstanceid BIGINT ,
13
+ createtime TIMESTAMP ,
14
+ starttime TIMESTAMP ,
15
+ endtime TIMESTAMP ,
16
+ updatetime TIMESTAMP ,
17
+ parameters BLOB,
18
+ batchstatus VARCHAR (512 ),
19
+ exitstatus VARCHAR (512 ),
20
+ CONSTRAINT JOBINST_JOBEXEC_FK FOREIGN KEY (jobinstanceid) REFERENCES JOBINSTANCEDATA (jobinstanceid) ON DELETE CASCADE
21
+ );
22
+ CREATE TABLE IF NOT EXISTS STEPEXECUTIONINSTANCEDATA
23
+ (
24
+ stepexecid BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1 ) PRIMARY KEY ,
25
+ jobexecid BIGINT ,
26
+ batchstatus VARCHAR (512 ),
27
+ exitstatus VARCHAR (512 ),
28
+ stepname VARCHAR (512 ),
29
+ readcount INTEGER ,
30
+ writecount INTEGER ,
31
+ commitcount INTEGER ,
32
+ rollbackcount INTEGER ,
33
+ readskipcount INTEGER ,
34
+ processskipcount INTEGER ,
35
+ filtercount INTEGER ,
36
+ writeskipcount INTEGER ,
37
+ startTime TIMESTAMP ,
38
+ endTime TIMESTAMP ,
39
+ persistentData BLOB,
40
+ CONSTRAINT JOBEXEC_STEPEXEC_FK FOREIGN KEY (jobexecid) REFERENCES EXECUTIONINSTANCEDATA (jobexecid) ON DELETE CASCADE
41
+ );
42
+ CREATE TABLE IF NOT EXISTS JOBSTATUS
43
+ (
44
+ id BIGINT PRIMARY KEY ,
45
+ obj BLOB,
46
+ CONSTRAINT JOBSTATUS_JOBINST_FK FOREIGN KEY (id) REFERENCES JOBINSTANCEDATA (jobinstanceid) ON DELETE CASCADE
47
+ );
48
+ CREATE TABLE IF NOT EXISTS STEPSTATUS
49
+ (
50
+ id BIGINT PRIMARY KEY ,
51
+ obj BLOB,
52
+ CONSTRAINT STEPSTATUS_STEPEXEC_FK FOREIGN KEY (id) REFERENCES STEPEXECUTIONINSTANCEDATA (stepexecid) ON DELETE CASCADE
53
+ );
54
+ CREATE TABLE IF NOT EXISTS CHECKPOINTDATA
55
+ (
56
+ id VARCHAR (512 ),
57
+ obj BLOB
58
+ );
You can’t perform that action at this time.
0 commit comments