Kodo 4.0: Kodo unable to use synonyms with native SchemaFactory.
(Doc ID 1144284.1)
Last updated on JUNE 25, 2021
Applies to:
Oracle Kodo - Version 4.0 and laterOracle WebLogic Server - Version 10.0 to 10.3
Information in this document applies to any platform.
Symptoms
When using native Kodo SchemaFactory with a JPA entity by specifying in the persistance.xml as below
<property name="kodo.jdbc.SchemaFactory" value="native(ForeignKeys=true)"/>
that is mapped to a synonym table inside the database (which is being used by the application) will fail to start up with below stack trace:
<openjpa-1.1.0-r422266:657916 fatal user error> org.apache.openjpa.persistence.ArgumentException: Errors encountered while resolving metadata. See nested exceptions for details.
at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:563)
at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:308)
at org.apache.openjpa.kernel.BrokerImpl.newObjectId(BrokerImpl.java:1114)
at org.apache.openjpa.kernel.DelegatingBroker.newObjectId(DelegatingBroker.java:268)
at org.apache.openjpa.persistence.EntityManagerImpl.find(EntityManagerImpl.java:451)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:90)
at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:89)
at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:80)
at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:24)
Steps to reproduce issue
========================
1. Create a schema XXXXXX, YYYYYY.
2. Create the table VF_SYN_TEST in that schema and give permissions:
CREATE TABLE "XXXXXX"."VF_SYN_TEST"
( "VF_SYN_TEST_ID" NUMBER(10,0),
"DETAILS" VARCHAR2(100 BYTE) NOT NULL ENABLE,
"DATE_INSERTED" DATE DEFAULT SYSDATE,
CONSTRAINT "PK_VF_SYN_TEST" PRIMARY KEY ("VF_SYN_TEST_ID")
);
grant all on VF_SYN_TEST to YYYYYY;
3. Log into a schema YYYYYY.
4. Create a synonym for the table:
CREATE OR REPLACE SYNONYM "YYYYYY"."VF_SYN_TEST" FOR
"XXXXXX"."VF_SYN_TEST";
5. Create a WebLogic domain with a datasource pointing at schema YYYYYY.
6. Any application on using this synonym table will fail.
Changes
N/A
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Symptoms |
Changes |
Cause |
Solution |
References |