CHAN Shih-Ping created OPENJPA-2839:
---------------------------------------
Summary: OpenJPA+H2 is finding USERS table from INFORMATION_SCHEMA
Key: OPENJPA-2839
URL: https://issues.apache.org/jira/browse/OPENJPA-2839
Project: OpenJPA
Issue Type: Bug
Components: jpa
Affects Versions: 3.1.0
Environment: Java 11, OpenJPA 3.1.0 (from TomEE), H2 1.4.200
Reporter: CHAN Shih-Ping
Using H2 as JDBC driver and metadata-only DDL schema generation:
{code:java}
<property name="javax.persistence.schema-generation.database.action"
value="drop-and-create" />
<property name="javax.persistence.sql-load-script-source"
value="initial-data.sql" />{code}
The Entity table is named "Users" but OpenJPA misdetects that the table exists
(it searches in the INFORMATION_SCHEMA as well, it seems), and so does not send
"CREATE TABLE..".
Instead it sends "ALTER TABLE...". In H2 this targets the PUBLIC schema and so
will fail as the "Users" table does not exist in the PUBLIC schema.
In contrast, hibernate detects that the table does not exist, and sends "CREATE
TABLE...".
--
This message was sent by Atlassian Jira
(v8.3.4#803005)