我以下列方式使用此方法
EntityManagerFactory emftemp = Persistence.createEntityManagerFactory("XYZ");
和我的persistence.xml
具有此单元的以下条目
<persistence-unit name="XYZ" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.hbm2ddl.auto" value="validate"/>
<property name="hibernate.query.substitutions" value="true=1, false=0"/>
<property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/>
<property name="hibernate.connection.url" value="jdbc:oracle:thin:@aesop-db.corp.nlg1.com:1521:TLCSDEV4"/>
<property name="hibernate.connection.username" value="abcd"/>
<property name="hibernate.connection.password" value="abcd"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9iDialect"/>
<property name="hibernate.connection.timeout" value="120"/>
<property name="hibernate.connection.provider_class" value="org.hibernate.connection.C3P0ConnectionProvider" />
<property name="hibernate.c3p0.min_size" value="2"/>
<property name="hibernate.c3p0.max_size" value="2"/>
<property name="hibernate.c3p0.idle_test_period" value="60"/>
</properties>
</persistence-unit>
这是一个Java应用程序,我使用的是hibernate3.jar,我使用的是ejb3-persistence.jar和JDK1.5。
问题在于,每次运行应用程序时,它都会挂起此调用。它没有抛出任何异常或错误。它只是挂在那一点上。
任何人都可以帮助确定它为什么不向前发展吗?
答案 0 :(得分:1)
两个想法:
答案 1 :(得分:-1)
我对Oracle 11g数据库遇到了同样的问题,只定义了三个实体,但是数据库非常庞大。从persistence.xml中注释掉以下行后,问题就解决了。
<property name="hibernate.hbm2ddl.auto" value="update"/>