I've been browsing the forums to see if anyone has come up with this problem but I don't think anyone has documented the exact issue that I am having.
I am trying to use Hibernate with a view in Oracle. The view has update triggers defined in order to make it an updateable view so that it effectively acts as a table.
The problem is that when my application starts I get the following error:
Code:
util.JDBCExceptionReporter ORA-01702: a view is not appropriate here
hbm2ddl.SchemaUpdate could not complete schema update
org.hibernate.exception.SQLGrammarException: could not get table metadata: CDS_CLIENT_ATTR_HIBERNATE
The common cause for receiving an error like this is because the database user does not have the ANALYZE ANY privilege granted. The user that I am connecting as does have ANALYZE ANY privillages.
My guess is that the reason this is occuring is that Hibernate would be running a command on Oracle like:
Code:
ANALYZE TABLE CDS_CLIENT_ATTR_HIBERNATE VALIDATE STRUCTURE CASCADE
...and Oracle would then be returning the ORA-01702 error because the object it is trying to analyze is a view which is not supported by the ANALYZE TABLE command.
Is there any way that I can fix this error so it doesn't occur.
Thanks in advance,
James