Hey Chaps,
I have two Oracle databases so instead of two sessions, I created synonyms and only used the one datasource.
The synonyms have select permission granted but no write permissions.
The classes corresponding to the synonyms are marked
Code:
mutable="false"
in the mappings.
On startup the SchemaUpdate fails to get the metadata. Hibernate continues to startup and allows queries on the tables so they are accessible to JDBC.
I see from the Hibernate FAQ
The SchemaUpdate tool doesn't work and I gather this is one of those times but....
does anyone know a way around this problem?
Thanks,
Tim
Hibernate version: 2.1.7
Mapping documents:Code:
<hibernate-mapping>
<class name="omnieng.burnbaby.beans.Camera" table="CAMERA" mutable="false">
<id name="id" column="cam_id" type="integer">
<generator class="increment"/>
</id>
<property name="description" column="cam_desc"/>
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:Code:
net.sf.hibernate.HibernateException: java.sql.SQLException: ORA-01031: insufficient privileges
at net.sf.hibernate.tool.hbm2ddl.DatabaseMetadata.getTableMetadata(DatabaseMetadata.java:83)
at net.sf.hibernate.cfg.Configuration.generateSchemaUpdateScript(Configuration.java:557)
at net.sf.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:129)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:199)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:796)
at omnieng.burnbaby.util.HibernateUtil.<clinit>(HibernateUtil.java:24)
at omnieng.burnbaby.beans.NVSManager.getELR(NVSManager.java:130)
at omnieng.burnbaby.tests.BasicNVSTests.testGetELR(BasicNVSTests.java:44)
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:324)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.swingui.TestRunner$16.run(TestRunner.java:623)
Caused by: java.sql.SQLException: ORA-01031: insufficient privileges
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:796)
at oracle.jdbc.OracleDatabaseMetaData.getIndexInfo(OracleDatabaseMetaData.java:3669)
at net.sf.hibernate.tool.hbm2ddl.TableMetadata.initIndexes(TableMetadata.java:131)
at net.sf.hibernate.tool.hbm2ddl.TableMetadata.<init>(TableMetadata.java:36)
Name and version of the database you are using:Oracle 9i
Debug level Hibernate log excerpt:Code:
[DEBUG,DriverManagerConnectionProvider] created connection to: jdbc:oracle:thin:nvs_burn/nvs_burn@rsom-yok-a01.omnieng.co.uk:1521:nvsorigp, Isolation Level: 2
[INFO,SchemaUpdate] updating schema
[INFO,Configuration] processing one-to-many association mappings
[INFO,Configuration] processing one-to-one association property references
[INFO,Configuration] processing foreign key constraints
[DEBUG,Configuration] resolving reference to class: omnieng.burnbaby.beans.ELR
[DEBUG,Configuration] resolving reference to class: omnieng.burnbaby.beans.Order
[INFO,DatabaseMetadata] table not found: elr
[INFO,DatabaseMetadata] table not found: CAMERA
[INFO,DatabaseMetadata] table not found: elrtrid
[ERROR,SchemaUpdate] could not complete schema update