I am migrating to hibernate 4.1 and also adding support for oracle 11g. The migration to 4.1 appears to have gone ok with the mysql setup and I am debugging oracle specific problems. I have an issue where oracle complains with
java.sql.SQLException: ORA-00903: invalid table name
I should mention this setup is also using c3p0 and ehcache.
The query that causes this exception is:
DEBUG org.hibernate.SQL -
select
dp.id as id168_,
dp.Description as Descript2_168_,
dp.name as name168_,
case
when dp1_.id is not null then 1
when dp2_.id is not null then 2
when dp.id is not null then 0
end as clazz_
from
.tableA dp
left outer join
.tableB dp1_
on dp.id=dp1_.id
left outer join
.tableC dp2_
on dp.id=dp2_.id
I tried this query in SQL Developer and it failed. The problem appears to be with the ‘.’ on the table names. If I remove this or put the db user/schema before the query is good.
Is there a setting to turn this notation off?
Have I not provided a property that is needed?
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver"/>
<property name="hibernate.connection.username" value="myUser"/>
<property name="hibernate.connection.password" value="myPassword"/>
<property name="hibernate.connection.url" value="jdbc:oracle:thin://@192.168.X.X:1521:oracledb"/>
<property name="hibernate.archive.autodetection" value=""/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.default_schema" value="public"/>
<property name="hibernate.ejb.cfgfile" value="META-INF/hibernate.cfg.xml"/>
<!-- cache configuration -->
<property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory" />
<property name="hibernate.cache.use_second_level_cache" value="true"/>
<property name="hibernate.cache.use_query_cache" value="true"/>
<!-- pool configuration -->
<property name="hibernate.connection.provider_class" value="org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider" />
<property name="hibernate.c3p0.max_size" value="50" />
<property name="hibernate.c3p0.min_size" value="5" />
<property name="hibernate.c3p0.acquire_increment" value="1" />
<property name="hibernate.c3p0.idle_test_period" value="17" />
<property name="hibernate.c3p0.max_statements" value="0" />
<property name="hibernate.c3p0.timeout" value="3600" />
<property name="hibernate.c3p0.preferredTestQuery" value="SELECT 1 FROM DUAL"/>
</properties>
This problem was with
This value needs to match the schema that you have created.
ctapobep’s comment helped identify this problem.