Hi
I have an application based on DB2. My application has a table named 'roles', set hibernate hbm2ddl.auto=update. When first deploy my application, hiberante finds a built-in table 'roles' already in syscat schema, so it will not create my 'roles' any more.
Below is my hibernate.hbm.xml:
Code:
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="connection.datasource">java:comp/env/jdbc/MyDatabase</property>
<!-- JDBC connection pool (use the built-in) -->
<property name="c3p0.min_size">5</property>
<property name="c3p0.max_size">25</property>
<property name="c3p0.timeout">1800</property>
<property name="c3p0.max_statements">100</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.DB2Dialect</property>
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.OSCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">false</property>
<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">update</property>
<mapping resource="mapping.hbm.xml"/>
<mapping resource="version_mapping.hbm.xml"/>
</session-factory>
</hibernate-configuration>
My datasource definition:
Code:
<Resource name="jdbc/MyDatabase" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="50" maxWait="10000"
username="db2admin" password="db2admin"
driverClassName="com.ibm.db2.jcc.DB2Driver"
url="jdbc:db2://192.168.56.101:50000/UDDI:traceLevel=3;driverType=4;currentSchema=MYSCHEMA;"/>
I already assign currentSchema with MYSCHEMA. Seems hibernate doesn't find 'roles' in my schema but in syscat.
This happened in hibernate 3.2.6. Hibernate 3.2.5 works fine.
I saw hibernate 3.2.6 changelog:
* [HHH-2070] - Expand DB2Dialect auto-discovery support (Martin Renner)
Is it because of this patch?
Any help will be appreciated.