[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1785) validate not working with oracle dblinks

Ben Turner (JIRA) noreply at atlassian.com
Fri Jan 18 07:27:56 EST 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29366 ] 

Ben Turner commented on HHH-1785:
---------------------------------

I use Oracle database links with Public Synonyms, and have a related problem.

My table, lets call it DATA at OTHERDB is owned by DB_OWNER. So we have setup a view to the table called DATA_V, again owned by DB_OWNER, that points at the table. Then finally we have a public synonym pointing DATA at DB_OWNER.DATA_V

However, I get trouble when using Chris Richardson's ORMUnit ( http://ormunit.googlecode.com) which sets up a Hibernate Configuration object then calls configuration.generateSchemaUpdateScript(dialect, dbmd) which it then would go on to parse the output for missing / extra items.

This call fails with the following in the logs:
2008-01-18 12:00:13,714 [main] INFO  org.hibernate.tool.hbm2ddl.TableMetadata  - table found: DB_OWNER.LOCAL_TABLE
2008-01-18 12:00:13,714 [main] INFO  org.hibernate.tool.hbm2ddl.TableMetadata  - columns: [id, column1, other_column]
2008-01-18 12:00:13,714 [main] INFO  org.hibernate.tool.hbm2ddl.TableMetadata  - foreign keys: [...]
2008-01-18 12:00:13,714 [main] INFO  org.hibernate.tool.hbm2ddl.TableMetadata  - indexes: [...]
2008-01-18 12:00:13,729 [main] INFO  org.hibernate.tool.hbm2ddl.DatabaseMetadata  - table not found: DATA

So I am guessing the schema update script is presuming the table is local and not over a database link.

> validate not working with oracle dblinks
> ----------------------------------------
>
>                 Key: HHH-1785
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1785
>             Project: Hibernate3
>          Issue Type: Bug
>    Affects Versions: 3.1 rc2
>         Environment: Hibernate:  3.1.rc2
> Database: Oracle 9i
>            Reporter: Arik Galansky
>
> Full stack trace of any exception that occurs:
> Don't have a full stack availible, but here is the last part:
> Caused by:org.hibernate.HibernateException: Missing Table: table at dblink
> org.hibernate.cfg.Configuration.ValidateSchema (Configuration.java953)
> Name and version of the database you are using: Oracle 9i
> the problem is that when I set the hibernate.hbm2ddl.auto to validate I get the mentioned below Exception on a table that is found on a remote DB/
> important to note that I can select from the table when it comes to queries, but only if I put it the hbm2ddl on "update" mode which is ofcourse not healthy considering I don't want the EJB to alternate my DB stracture in any way.
> * important to mention that the user on the other side of the DBlink has the "select any dictionary" grant so he should have no problem selecting from the dba_* tables.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list