Skip to content
Merged
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
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -966,8 +966,8 @@ task pullPlugin(group: ofbizPlugin, description: 'Download and install a plugin
task cleanCatalina(group: cleanupGroup, description: 'Clean Catalina data in runtime/catalina/work') {
doLast { delete "${rootDir}/runtime/catalina/work" }
}
task cleanData(group: cleanupGroup, description: 'Clean all DB data (Derby) under runtime/data') {
doLast { deleteAllInDirWithExclusions("${rootDir}/runtime/data/", ['README', 'derby.properties']) }
task cleanData(group: cleanupGroup, description: 'Clean all DB data (H2) under runtime/data') {
doLast { deleteAllInDirWithExclusions("${rootDir}/runtime/data/", ['README', '.h2.server.properties']) }
}
task cleanDownloads(group: cleanupGroup, description: 'Clean all downloaded files') {
doLast {
Expand Down
3 changes: 1 addition & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ dependencies {
runtimeOnly 'org.apache.avalon.framework:avalon-framework-impl:4.3.1'
runtimeOnly 'org.apache.axis2:axis2-transport-http:1.8.2'
runtimeOnly 'org.apache.axis2:axis2-transport-local:1.8.2'
runtimeOnly 'org.apache.derby:derby:10.16.1.1' // 10.17.x.x requires Java 21
runtimeOnly 'org.apache.derby:derbytools:10.16.1.1' // 10.17.x.x requires Java 21
runtimeOnly 'com.h2database:h2:2.2.224'
runtimeOnly 'org.apache.geronimo.specs:geronimo-jaxrpc_1.1_spec:2.1'
runtimeOnly 'org.apache.logging.log4j:log4j-1.2-api:2.25.4' // for external jars using the old log4j1.2: routes logging to log4j 2
runtimeOnly 'org.apache.logging.log4j:log4j-jul:2.25.4' // for external jars using the java.util.logging: routes logging to log4j 2
Expand Down
2 changes: 1 addition & 1 deletion docker/templates/postgres-entityengine.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ access. For a detailed description see the core/docs/entityconfig.html file.

<!-- Be sure that your default delegator (or the one you use) uses the same datasource for test. You must run "gradlew loadAll" before running "gradlew testIntegration" -->
<delegator name="test" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main">
<group-map group-name="org.apache.ofbiz" datasource-name="localderby"/>
<group-map group-name="org.apache.ofbiz" datasource-name="localpostgres"/>
<group-map group-name="org.apache.ofbiz.olap" datasource-name="localpostgresolap"/>
<group-map group-name="org.apache.ofbiz.tenant" datasource-name="localpostgrestenant"/>
</delegator>
Expand Down
8 changes: 4 additions & 4 deletions framework/base/config/passwords.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# under the License.
###############################################################################

jdbc-password.derby-ofbiz=ofbiz
jdbc-password.derby-ofbizodbc=ofbiz
jdbc-password.derby-ofbizolap=ofbiz
jdbc-password.derby-ofbiztenant=ofbiz
jdbc-password.h2-ofbiz=ofbiz
jdbc-password.h2-ofbizodbc=ofbiz
jdbc-password.h2-ofbizolap=ofbiz
jdbc-password.h2-ofbiztenant=ofbiz
112 changes: 63 additions & 49 deletions framework/entity/config/entityengine.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,22 @@ access. For a detailed description see the core/docs/entityconfig.html file.
<debug-xa-resources value="false" /> <!-- see https://issues.apache.org/jira/browse/OFBIZ-4282 for more -->

<delegator name="default" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" distributed-cache-clear-enabled="false">
<group-map group-name="org.apache.ofbiz" datasource-name="localderby"/>
<group-map group-name="org.apache.ofbiz.olap" datasource-name="localderbyolap"/>
<group-map group-name="org.apache.ofbiz.tenant" datasource-name="localderbytenant"/>
<group-map group-name="org.apache.ofbiz" datasource-name="localh2"/>
<group-map group-name="org.apache.ofbiz.olap" datasource-name="localh2olap"/>
<group-map group-name="org.apache.ofbiz.tenant" datasource-name="localh2tenant"/>
</delegator>
<!-- May be used when you create a service that manages many data for massive imports, this for performance reason or to escape functional cases -->
<delegator name="default-no-eca" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" entity-eca-enabled="false" distributed-cache-clear-enabled="false">
<group-map group-name="org.apache.ofbiz" datasource-name="localderby"/>
<group-map group-name="org.apache.ofbiz.olap" datasource-name="localderbyolap"/>
<group-map group-name="org.apache.ofbiz.tenant" datasource-name="localderbytenant"/>
<group-map group-name="org.apache.ofbiz" datasource-name="localh2"/>
<group-map group-name="org.apache.ofbiz.olap" datasource-name="localh2olap"/>
<group-map group-name="org.apache.ofbiz.tenant" datasource-name="localh2tenant"/>
</delegator>

<!-- Be sure that your default delegator (or the one you use) uses the same datasource for test. You must run "gradlew loadAll" before running "gradlew testIntegration" -->
<delegator name="test" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main">
<group-map group-name="org.apache.ofbiz" datasource-name="localderby"/>
<group-map group-name="org.apache.ofbiz.olap" datasource-name="localderbyolap"/>
<group-map group-name="org.apache.ofbiz.tenant" datasource-name="localderbytenant"/>
<group-map group-name="org.apache.ofbiz" datasource-name="localh2"/>
<group-map group-name="org.apache.ofbiz.olap" datasource-name="localh2olap"/>
<group-map group-name="org.apache.ofbiz.tenant" datasource-name="localh2tenant"/>
</delegator>

<!-- need to at least define a name for each component to use -->
Expand Down Expand Up @@ -98,7 +98,7 @@ access. For a detailed description see the core/docs/entityconfig.html file.
<entity-data-reader name="ext-demo"/>

<field-type name="hsql" loader="fieldfile" location="fieldtypehsql.xml"/>
<field-type name="derby" loader="fieldfile" location="fieldtypederby.xml"/>
<field-type name="h2" loader="fieldfile" location="fieldtypeh2.xml"/>
<field-type name="daffodil" loader="fieldfile" location="fieldtypedaffodil.xml"/>
<field-type name="axion" loader="fieldfile" location="fieldtypeaxion.xml"/>
<field-type name="mysql" loader="fieldfile" location="fieldtypemysql.xml"/>
Expand Down Expand Up @@ -157,12 +157,13 @@ access. For a detailed description see the core/docs/entityconfig.html file.
<!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="localhsqlDataSource"/> --> <!-- Weblogic Style JNDI name -->
</datasource>

<datasource name="localderby"
<datasource name="localh2"
helper-class="org.apache.ofbiz.entity.datasource.GenericHelperDAO"
schema-name="OFBIZ"
field-type-name="derby"
field-type-name="h2"
check-on-start="true"
add-missing-on-start="true"
max-worker-pool-size="1"
use-pk-constraint-names="false"
use-indices-unique="false"
alias-view-columns="false"
Expand All @@ -175,55 +176,61 @@ access. For a detailed description see the core/docs/entityconfig.html file.
<read-data reader-name="ext"/>
<read-data reader-name="ext-test"/>
<read-data reader-name="ext-demo"/>
<!-- beware use-indices-unique="false" is needed because of Derby bug with null values in a unique index -->

<inline-jdbc
jdbc-driver="org.apache.derby.jdbc.EmbeddedDriver"
jdbc-uri="jdbc:derby:ofbiz;create=true"
jdbc-driver="org.h2.Driver"
jdbc-uri="jdbc:h2:file:./runtime/data/h2/ofbiz;AUTO_SERVER=TRUE;LOCK_TIMEOUT=60000;INIT=CREATE SCHEMA IF NOT EXISTS OFBIZ"
jdbc-username="ofbiz"
jdbc-password-lookup="derby-ofbiz"
jdbc-password-lookup="h2-ofbiz"
isolation-level="ReadCommitted"
pool-minsize="2"
pool-minsize="0"
pool-maxsize="250"
pool-sleeptime="300000"
test-on-borrow="true"
pool-jdbc-test-stmt="values 1"
pool-jdbc-test-stmt="SELECT 1"
soft-min-evictable-idle-time-millis="600000"
time-between-eviction-runs-millis="600000"/>
<!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/DerbyDataSource" isolation-level="ReadCommitted"/> -->
<!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/H2DataSource" isolation-level="ReadCommitted"/> -->
</datasource>
<datasource name="localderbyodbc"
<datasource name="localh2odbc"
helper-class="org.apache.ofbiz.entity.datasource.GenericHelperDAO"
schema-name="OFBIZ"
field-type-name="derby"
schema-name="ODBC"
field-type-name="h2"
check-on-start="true"
add-missing-on-start="true"
max-worker-pool-size="1"
use-pk-constraint-names="false"
use-indices-unique="false"
alias-view-columns="false"
use-order-by-nulls="true"
offset-style="fetch">
<!-- beware use-indices-unique="false" is needed because of Derby bug with null values in a unique index -->

<inline-jdbc
jdbc-driver="org.apache.derby.jdbc.EmbeddedDriver"
jdbc-uri="jdbc:derby:ofbizodbc;create=true"
jdbc-driver="org.h2.Driver"
jdbc-uri="jdbc:h2:file:./runtime/data/h2/ofbiz;AUTO_SERVER=TRUE;LOCK_TIMEOUT=60000;INIT=CREATE SCHEMA IF NOT EXISTS ODBC"
jdbc-username="ofbiz"
jdbc-password-lookup="derby-ofbizodbc"
jdbc-password-lookup="h2-ofbizodbc"
isolation-level="ReadCommitted"
pool-minsize="2"
pool-minsize="0"
pool-maxsize="250"
time-between-eviction-runs-millis="600000"/>
<!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/DerbyDataSource" isolation-level="ReadCommitted"/> -->
pool-sleeptime="300000"
test-on-borrow="true"
pool-jdbc-test-stmt="SELECT 1"
time-between-eviction-runs-millis="600000"/>
<!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/H2DataSource" isolation-level="ReadCommitted"/> -->
</datasource>
<datasource name="localderbyolap"
<datasource name="localh2olap"
helper-class="org.apache.ofbiz.entity.datasource.GenericHelperDAO"
schema-name="OFBIZ"
field-type-name="derby"
schema-name="OLAP"
field-type-name="h2"
check-on-start="true"
add-missing-on-start="true"
max-worker-pool-size="1"
use-pk-constraint-names="false"
use-indices-unique="false"
alias-view-columns="false"
use-order-by-nulls="true">
<!-- beware use-indices-unique="false" is needed because of Derby bug with null values in a unique index -->

<read-data reader-name="tenant"/>
<read-data reader-name="seed"/>
<read-data reader-name="seed-initial"/>
Expand All @@ -232,22 +239,26 @@ access. For a detailed description see the core/docs/entityconfig.html file.
<read-data reader-name="ext-test"/>
<read-data reader-name="ext-demo"/>
<inline-jdbc
jdbc-driver="org.apache.derby.jdbc.EmbeddedDriver"
jdbc-uri="jdbc:derby:ofbizolap;create=true"
jdbc-driver="org.h2.Driver"
jdbc-uri="jdbc:h2:file:./runtime/data/h2/ofbiz;AUTO_SERVER=TRUE;LOCK_TIMEOUT=60000;INIT=CREATE SCHEMA IF NOT EXISTS OLAP"
jdbc-username="ofbiz"
jdbc-password-lookup="derby-ofbizolap"
jdbc-password-lookup="h2-ofbizolap"
isolation-level="ReadCommitted"
pool-minsize="2"
pool-minsize="0"
pool-maxsize="250"
pool-sleeptime="300000"
test-on-borrow="true"
pool-jdbc-test-stmt="SELECT 1"
time-between-eviction-runs-millis="600000"/>
<!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/DerbyDataSource" isolation-level="ReadCommitted"/> -->
<!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/H2DataSource" isolation-level="ReadCommitted"/> -->
</datasource>
<datasource name="localderbytenant"
<datasource name="localh2tenant"
helper-class="org.apache.ofbiz.entity.datasource.GenericHelperDAO"
schema-name="OFBIZ"
field-type-name="derby"
schema-name="TENANT"
field-type-name="h2"
check-on-start="true"
add-missing-on-start="true"
max-worker-pool-size="1"
use-pk-constraint-names="false"
use-indices-unique="false"
alias-view-columns="false"
Expand All @@ -259,17 +270,20 @@ access. For a detailed description see the core/docs/entityconfig.html file.
<read-data reader-name="ext"/>
<read-data reader-name="ext-test"/>
<read-data reader-name="ext-demo"/>
<!-- beware use-indices-unique="false" is needed because of Derby bug with null values in a unique index -->

<inline-jdbc
jdbc-driver="org.apache.derby.jdbc.EmbeddedDriver"
jdbc-uri="jdbc:derby:ofbiztenant;create=true"
jdbc-driver="org.h2.Driver"
jdbc-uri="jdbc:h2:file:./runtime/data/h2/ofbiz;AUTO_SERVER=TRUE;LOCK_TIMEOUT=60000;INIT=CREATE SCHEMA IF NOT EXISTS TENANT"
jdbc-username="ofbiz"
jdbc-password-lookup="derby-ofbiztenant"
jdbc-password-lookup="h2-ofbiztenant"
isolation-level="ReadCommitted"
pool-minsize="2"
pool-minsize="0"
pool-maxsize="250"
pool-sleeptime="300000"
test-on-borrow="true"
pool-jdbc-test-stmt="SELECT 1"
time-between-eviction-runs-millis="600000"/>
<!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/DerbyDataSource" isolation-level="ReadCommitted"/> -->
<!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/H2DataSource" isolation-level="ReadCommitted"/> -->
</datasource>

<datasource name="localdaffodil"
Expand Down Expand Up @@ -810,12 +824,12 @@ access. For a detailed description see the core/docs/entityconfig.html file.
time-between-eviction-runs-millis="600000"/>
</datasource>

<!-- According to http://markmail.org/message/s75sf6zhtizzkqbv Since version V6R1 (AS/400, db2) there is no need for an own fieldtype.xml - just use the derby-fieldtypes like this: -->
<!-- According to http://markmail.org/message/s75sf6zhtizzkqbv Since version V6R1 (AS/400, db2) there is no need for an own fieldtype.xml - just use the h2-fieldtypes like this: -->
<!-- Beware use-indices-unique="false" is needed because of Derby bug with null values in a unique index, not sure it's needed with DB2 -->
<datasource name="DB2"
helper-class="org.apache.ofbiz.entity.datasource.GenericHelperDAO"
schema-name="OFBIZ"
field-type-name="derby"
field-type-name="h2"
check-on-start="true"
add-missing-on-start="true"
use-pk-constraint-names="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2174,7 +2174,7 @@ public Element toGroupXmlElement(Document document, String packageName) {
public void writeEoModelText(PrintWriter writer, String entityPrefix, String helperName, Set<String> entityNameIncludeSet,
ModelReader entityModelReader) throws GenericEntityException {
if (entityPrefix == null) entityPrefix = "";
if (helperName == null) helperName = "localderby";
if (helperName == null) helperName = "localh2";

UtilPlist.writePlistPropertyMap(this.createEoModelMap(entityPrefix, helperName, entityNameIncludeSet, entityModelReader), 0, writer, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public class DelegatorUnitTests {
@Before
public void initialize() {
System.setProperty("ofbiz.home", System.getProperty("user.dir"));
System.setProperty("derby.system.home", "./runtime/data/derby");
logErrorOn = Debug.isOn(Debug.ERROR); // save the current setting (to be restored after the tests)
Debug.set(Debug.ERROR, false); // disable error logging
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ under the License.
<Tenant tenantId="@tenantId@" tenantName="@tenantName@" />
<TenantDomainName tenantId="@tenantId@" domainName="@domainName@" />
<TenantDataSource tenantId="@tenantId@" entityGroupName="org.apache.ofbiz"
jdbcUri="jdbc:derby:ofbiz_@tenantId@;create=true" jdbcUsername="ofbiz" jdbcPassword="ofbiz"/>
jdbcUri="jdbc:h2:file:./runtime/data/h2/ofbiz_@tenantId@;AUTO_SERVER=TRUE" jdbcUsername="ofbiz" jdbcPassword="ofbiz"/>
<TenantDataSource tenantId="@tenantId@" entityGroupName="org.apache.ofbiz.olap"
jdbcUri="jdbc:derby:ofbizolap_@tenantId@;create=true" jdbcUsername="ofbiz" jdbcPassword="ofbiz"/>
</entity-engine-xml>
jdbcUri="jdbc:h2:file:./runtime/data/h2/ofbizolap_@tenantId@;AUTO_SERVER=TRUE" jdbcUsername="ofbiz" jdbcPassword="ofbiz"/>
</entity-engine-xml>
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class ModelServiceTest {
@Before
void initialize() {
System.setProperty('ofbiz.home', System.getProperty('user.dir'))
System.setProperty('derby.system.home', './runtime/data/derby')
dispatcher = Mockito.mock(LocalDispatcher)
Mockito.when(dispatcher.getDelegator()).thenReturn(DelegatorFactory.getDelegator('default'))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ public Path getOfbizHome() {
// set system properties
System.setProperty("ofbiz.home", ofbizHome.toString());
System.setProperty("java.awt.headless", getProperty(props, "java.awt.headless", "true"));
System.setProperty("derby.system.home", getProperty(props, "derby.system.home", "runtime/data/derby"));

// set default locale and timezone
Locale.setDefault(getDefaultLocale(props, "en"));
TimeZone.setDefault(getDefaultTimeZone(props));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ ofbiz.start.loaders=main
# --- logs directory relative to ofbiz.home. Default is runtime/logs
#ofbiz.log.dir=

# --- Derby directory relative to ofbiz.home. Default is runtime/data/derby
#derby.system.home=

# --- Container config file relative to ofbiz.home.
# Default is framework/base/config/ofbiz-containers.xml
#ofbiz.container.config=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ public static Map<String, Object> exportEntityEoModelBundle(DispatchContext dctx
String datasourceName = (String) context.get("datasourceName");
String entityNamePrefix = (String) context.get("entityNamePrefix");
Locale locale = (Locale) context.get("locale");
if (datasourceName == null) datasourceName = "localderby";
if (datasourceName == null) datasourceName = "localh2";

ModelReader reader = dctx.getDelegator().getModelReader();

Expand Down
28 changes: 0 additions & 28 deletions runtime/data/derby.properties

This file was deleted.

Loading