This is an automated email from the ASF dual-hosted git repository.
ashishvijaywargiya pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new 0fe65ee8bb OFBIZ-13412 - Fixing the SQL queries.
0fe65ee8bb is described below
commit 0fe65ee8bb2c85a26a2cc5069f8ae7da55937a90
Author: Ashish Vijaywargiya <[email protected]>
AuthorDate: Mon May 18 10:37:51 2026 +0530
OFBIZ-13412 - Fixing the SQL queries.
https://localhost:8443/webtools/control/EntitySQLProcessor
The SQL queries were not working in the above URL,
SQL Exception while executing the following:select * from person (Table
"PERSON" not found; SQL statement: select * from person [42102-240])
Additional details: When OFBiz sets up the H2 database, it creates the
tables within a specific schema named OFBIZ (and ODBC, OLAP, TENANT for the
other datasources). However, H2 uses the PUBLIC schema by default for incoming
connections. Because of this mismatch, any direct SQL query without a schema
prefix like select * from person tries to locate the table in the PUBLIC schema
and fails.
With Derby, the default schema used to automatically align with the
username (e.g., ofbiz), which is why the query used to work seamlessly there.
I updated the jdbc-uri property for all four H2 datasources to append \;SET
SCHEMA <SCHEMA_NAME> to their INIT configurations.
Now SQL queries are working fine.
---
framework/entity/config/entityengine.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/framework/entity/config/entityengine.xml
b/framework/entity/config/entityengine.xml
index 74ab1741a4..b4329ef0cd 100644
--- a/framework/entity/config/entityengine.xml
+++ b/framework/entity/config/entityengine.xml
@@ -179,7 +179,7 @@ access. For a detailed description see the
core/docs/entityconfig.html file.
<inline-jdbc
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-uri="jdbc:h2:file:./runtime/data/h2/ofbiz;AUTO_SERVER=TRUE;LOCK_TIMEOUT=60000;INIT=CREATE
SCHEMA IF NOT EXISTS OFBIZ\;SET SCHEMA OFBIZ"
jdbc-username="ofbiz"
jdbc-password-lookup="h2-ofbiz"
isolation-level="ReadCommitted"
@@ -207,7 +207,7 @@ access. For a detailed description see the
core/docs/entityconfig.html file.
<inline-jdbc
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-uri="jdbc:h2:file:./runtime/data/h2/ofbiz;AUTO_SERVER=TRUE;LOCK_TIMEOUT=60000;INIT=CREATE
SCHEMA IF NOT EXISTS ODBC\;SET SCHEMA ODBC"
jdbc-username="ofbiz"
jdbc-password-lookup="h2-ofbizodbc"
isolation-level="ReadCommitted"
@@ -240,7 +240,7 @@ access. For a detailed description see the
core/docs/entityconfig.html file.
<read-data reader-name="ext-demo"/>
<inline-jdbc
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-uri="jdbc:h2:file:./runtime/data/h2/ofbiz;AUTO_SERVER=TRUE;LOCK_TIMEOUT=60000;INIT=CREATE
SCHEMA IF NOT EXISTS OLAP\;SET SCHEMA OLAP"
jdbc-username="ofbiz"
jdbc-password-lookup="h2-ofbizolap"
isolation-level="ReadCommitted"
@@ -273,7 +273,7 @@ access. For a detailed description see the
core/docs/entityconfig.html file.
<inline-jdbc
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-uri="jdbc:h2:file:./runtime/data/h2/ofbiz;AUTO_SERVER=TRUE;LOCK_TIMEOUT=60000;INIT=CREATE
SCHEMA IF NOT EXISTS TENANT\;SET SCHEMA TENANT"
jdbc-username="ofbiz"
jdbc-password-lookup="h2-ofbiztenant"
isolation-level="ReadCommitted"