Datanucleus를 사용하여 Oracle 데이터베이스에 액세스하려고하면 이상한 문제가 발생합니다. 요약하면 다음과 같습니다.데이터 핵 + jpa + 오라클. 테이블이없는 이상한 오류
- 응용 프로그램을 실행합니다. datanucleus가 초기화되면 테이블을 찾을 수 없다는 불만을 토로합니다 (테이블에 있음에도 불구하고).
는 내가의 persistence.xml에
datanucleus.autoCreateSchema = true
... 속성을 추가, 나는 테이블을 드롭 응용 프로그램을 중지하고, 모든 작품 - 테이블은 선택의 작품을 만들고있다.
위의 매개 변수를 사용하지 않고 응용 프로그램을 다시 중지하려고 시도합니다.
- 처음에는 테이블을 만든 Datanucleus 였지만 오류가 발생했습니다. 이제 테이블을 찾지 못해서 오류가 발생합니다.
- 또한 동일한 설정이 문제없이 postgresql 데이터베이스와 함께 작동합니다.
누군가 도와주세요. 내 설정에 대한
몇 가지 세부 사항 : 나는 오라클 얇은 드라이버를 사용하고
- .
내 엔티티 클래스
는 다음과 같이 주석됩니다
@Entity
@Table(name = "tablename1", schema = "schema2000")
내가 스키마를 제거하면 모든 것이 OK 작동주의 = ... 주석에서
오류 메시지는 다음과 같습니다
16:05:40,216 DEBUG [DataNucleus.Connection] - Setting autocommit=false to connection: [email protected]
16:05:40,216 DEBUG [DataNucleus.Connection] - Connection "[email protected]" opened with isolation level "read-committed"
16:05:40,904 DEBUG [DataNucleus.Datastore.Schema] - Check of existence of schema2000.tablename1 returned table type of null
16:05:40,905 DEBUG [DataNucleus.Datastore.Schema] - An error occurred while auto-creating schema elements - rolling back
16:05:41,109 DEBUG [DataNucleus.Connection] - Connection "[email protected]" non enlisted to a transaction is being committed.
16:05:41,110 DEBUG [DataNucleus.Connection] - Connection "[email protected]" closed
javax.persistence.PersistenceException: Required table missing : "schema2000.tablename1" in Catalog "" Schema "schema2000". DataNucleus requires this table to perform its persistence operations. Either your MetaData is incorrect, or you need to enable "datanucleus.autoCreateTables"
at org.datanucleus.api.jpa.NucleusJPAHelper.getJPAExceptionForNucleusException(NucleusJPAHelper.java:274)
at org.datanucleus.api.jpa.JPAEntityManager.merge(JPAEntityManager.java:519)
오라클 사용 권한 문제를 배제 했습니까? DataNucleus가 사용하는 사용자와 연결된 SQL 클라이언트를 사용하여 테이블에서 선택할 수 있습니까? – MarkOfHall
예, 테이블을 만들고 동일한 실행에서 SELECT를 수행하면 올바르게 작동하기 때문에 사용 권한 문제가 배제됩니다. 귀찮게하는 부분은 "autoCreateSchema"가 비활성화 된 상태에서 다시 실행하면 더 이상 작동하지 않는다는 것입니다. – Andrei
'autoCreateSchema'를 실행 한 후에는 응용 프로그램 자격 증명을 사용하여 SQL 클라이언트가있는 db에 연결되었으며 테이블에서 선택할 수 있습니까? – MarkOfHall