Hi,
We've recently started doing some training projects on EJB 3 using oracle. We all have our own accounts and have created our tables using these accounts so they are all in their own schema and don't collide with each other.
The problem we are having is that when we deploy our entities to JBoss and hibernate validates them, it always checks against the same schema which appears to be the first user by alphabet.
Ex: We have 3 users Andrew, Ari, and Travis but when hibernate validates it always does it against ANDREW.[table name]. If I drop the user Andrew, then it starts validating against ARI.[table name].
None of use have set the default schema in either persistence.properties or persistence.xml and we don't have any other hibernate configuration files. Can anyone explain to me why it does this and how to fix it?
Thanks,
Drew
------
Setup:
Oracle 10g on linux
JBoss 4.0.4 rc2
Oracle-ds.xml
Code:
<datasources>
<local-tx-datasource>
<jndi-name>OracleDS</jndi-name>
<connection-url>jdbc:oracle:thin:@celos.qcomm.com:1521:celos</connection-url>
<driver-class>oracle.jdbc.pool.OracleDataSource</driver-class>
<user-name>andrew</user-name>
<password>drew</password>
<metadata>
<type-mapping>oracle</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
Persistence.xmlCode:
<persistence>
<persistence-unit name="custdb">
<jta-data-source>java:/OracleDS</jta-data-source>
<provider>org.hibernate.ejb.HibernatePersistence</provider>
</persistence>
persistence.propertiesCode:
hibernate.transaction.manager_lookup_class=org.hibernate.transaction.JBossTransactionManagerLookup
hibernate.connection.release_mode=after_statement
#hibernate.transaction.flush_before_completion=true
hibernate.transaction.auto_close_session=true
hibernate.query.factory_class=org.hibernate.hql.ast.ASTQueryTranslatorFactory
#hibernate.hbm2ddl.auto=create-drop
hibernate.hbm2ddl.auto=validate
hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
# Clustered cache with TreeCache
#hibernate.cache.provider_class=org.jboss.ejb3.entity.TreeCacheProviderHook
#hibernate.treecache.mbean.object_name=jboss.cache:service=EJB3EntityTreeCache
hibernate.dialect=org.hibernate.dialect.Oracle9Dialect
hibernate.jndi.java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
hibernate.jndi.java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
hibernate.cglib.use_reflection_optimizer=false
hibernate.show_sql=true