I'm using two different users for each app. In my previous post is the way I created the users in oracle. I let hibernate create the database from the mapping files. When I run the first app it creates the tables, but when I run the seccond app it says that the tables with the same name in both applications already exists :-(
For the first app, using user name CDI_USER
Code:
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@127.0.0.1:1521:ORCL</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.connection.username">CDI_USER</property>
<property name="hibernate.connection.password">somepwd</property>
<property name="hibernate.connection.pool_size">5</property>
<property name="hibernate.jdbc.batch_size">0</property>
<property name="hibernate.cglib.use_reflection_optimizer">false</property>
<property name="show_sql">false</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<!-- The mapping files, this is a common class betwen the two apps, but I whould like it to have nothing to do betwen them -->
<mapping resource="com/minotauro/pnf/model/audit/MTransactionAudit.hbm.xml"/>
<!-- Here there are more mapping files (one for class / table)-->
</session-factory>
</hibernate-configuration>
Seccond app, using ONT_USER
Code:
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@127.0.0.1:1521:ORCL</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.connection.username">ONT_USER</property>
<property name="hibernate.connection.password">sa003</property>
<property name="hibernate.connection.pool_size">5</property>
<property name="hibernate.jdbc.batch_size">0</property>
<property name="hibernate.cglib.use_reflection_optimizer">false</property>
<property name="show_sql">false</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<!-- The mapping files, this is a common class betwen the two apps, but I whould like it to have nothing to do betwen them -->
<mapping resource="com/minotauro/ont/model/audit/MTransactionAudit.hbm.xml"/>
<!-- Here there are more mapping files (one for class / table)-->
</session-factory>
</hibernate-configuration>
Regards, Demián.