hibernate could not commit 尽量使用容器提供的连接池,可能要把max statement设置为零。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是所有使用了HIBERNATE的地方都一起发生异常 对了,我用的数据库版本是mysql 4.0.18,需要什么补丁? 还有就是当hibernate不能正常运行的时候,使用JDBC直接操作的模块还能继续运行。 用hibernate访问数据库的程序、用jdbc访问数据库的程序、连接池怎么配的都发上来看看啊~ <hibernate-configuration> <session-factory> <!-- Database connection settings --> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.url"></property> <property name="hibernate.connection.username"></property> <property name="hibernate.connection.password"></property> <!-- SQL dialect --> <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property> <!-- Enable Hibernate's automatic session context management --> <property name="hibernate.current_session_context_class">thread</property> <!-- Disable the second-level cache --> <property name="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <mapping class="application.templet.NodeSetting"/> <mapping class="application.FormSetting"/> <mapping class="application.form.Custom"/> <mapping class="application.instance.LiveApplication"/> <mapping class="application.archive.ArchiveApplication"/> <mapping class="application.attachment.Attachment"/> <mapping class="application.templet.TemSetting"/> <mapping class="application.instance.Appointment"/> <mapping class="paperwork.FaWen"/> <mapping class="paperwork.ShouWen"/> <mapping class="paperwork.Folder"/> <mapping class="paperwork.File"/> </session-factory></hibernate-configuration> hibernate的配置文件好象不对吧,给一个你参考~<?xml version='1.0' encoding='utf-8'?><!DOCTYPE hibernate-configuration PUBLIC"-//Hibernate/Hibernate Configuration DTD 3.0//EN""http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><hibernate-configuration> <session-factory> <property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property> <!-- connection pool --><property name="connection.datasource">java:comp/env/mysql_ds</property> <!-- remove the commont if use the jdbc connect and remove datasource above --> <!-- <property name="connection.driver_class"> com.mysql.jdbc.Driver</property> <property name="connection.url">jdbc:mysql://localhost/docsys</property> <property name="connection.username">root</property> <property name="connection.password">123</property> --> <property name="jdbc.batch_size">10</property> <property name="jdbc.fetch_size">15</property> <property name="query.substitutions"> yes 'Y', no 'N',true 1, false 0</property> <property name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property> <property name="cache.use_query_caches">true</property> <property name="cache.region_prefix">hibernate.db</property> <property name="jdbc.use_streams_for_binary">true</property> <property name="jdbc.batch_versioned_data">false</property> <property name="connection.autocommit">false</property> <property name="transaction.auto_close_session">false</property> <property name="cglib.use_reflection_optimizer">true</property> <property name="show_sql">true</property> <property name="format_sql">true</property> <mapping resource="com/xzh/docsys/entity/Orgnization.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/User.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/Group.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/XzhDocument.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/File.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/SendDoc.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/ReceiveFile.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/PrintApp.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/Message.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/Popedom.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/OutSender.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/OutReceive.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/OutServer.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/OutPrintAppSend.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/OutPrintApp.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/RecPrintApp.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/RecPrintAppSend.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/ReadySendMessage.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/Part.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/PartPopedom.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/OutSenderFinish.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/GroupItems.hbm.xml"/> <!--stampSys --> <mapping resource="com/xzh/docsys/entity/ApplyStamp.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/SealModel.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/SealModelLog.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/Stamper.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/StamperLog.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/Check.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/DocsysLog.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/FileModel.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/FileStream.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/ModelStream.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/StampApply.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/StreamModel.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/SignList.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/OnlineMessage.hbm.xml"/> <mapping resource="com/xzh/docsys/entity/Function1.hbm.xml"/></session-factory></hibernate-configuration> Struts1.3.10 tld 问题 急急急!!! 在线等...想问一下大家jsp标签<c:forEach>取值的问题。。。。 答对后,马上给分。。。。。 Tomcat6.0 如何绑定域名 JAXP JAXB JAX-WS Axis2 XFire 关系? 再次求助面试题,还有个不会:( 理论性问题,求助! @@@@@谁了解大唐电信的面试~~~~~~~ hibernate 中的 get 和 load 的区别 linux 下 hibernate 缓存文件放置路径问题 求助Java解析大文件思路 SSH三者什么关系啊 jboss4.0.5 如何加载本地硬盘中的jar包
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url"></property>
<property name="hibernate.connection.username"></property>
<property name="hibernate.connection.password"></property> <!-- SQL dialect -->
<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property> <!-- Enable Hibernate's automatic session context management -->
<property name="hibernate.current_session_context_class">thread</property> <!-- Disable the second-level cache -->
<property name="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <mapping class="application.templet.NodeSetting"/>
<mapping class="application.FormSetting"/>
<mapping class="application.form.Custom"/>
<mapping class="application.instance.LiveApplication"/>
<mapping class="application.archive.ArchiveApplication"/>
<mapping class="application.attachment.Attachment"/>
<mapping class="application.templet.TemSetting"/>
<mapping class="application.instance.Appointment"/> <mapping class="paperwork.FaWen"/>
<mapping class="paperwork.ShouWen"/>
<mapping class="paperwork.Folder"/>
<mapping class="paperwork.File"/>
</session-factory></hibernate-configuration>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<!-- connection pool -->
<property name="connection.datasource">java:comp/env/mysql_ds</property> <!-- remove the commont if use the jdbc connect and remove datasource above -->
<!--
<property name="connection.driver_class"> com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/docsys</property>
<property name="connection.username">root</property>
<property name="connection.password">123</property>
-->
<property name="jdbc.batch_size">10</property>
<property name="jdbc.fetch_size">15</property>
<property name="query.substitutions"> yes 'Y', no 'N',true 1, false 0</property>
<property name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<property name="cache.use_query_caches">true</property>
<property name="cache.region_prefix">hibernate.db</property>
<property name="jdbc.use_streams_for_binary">true</property>
<property name="jdbc.batch_versioned_data">false</property>
<property name="connection.autocommit">false</property>
<property name="transaction.auto_close_session">false</property>
<property name="cglib.use_reflection_optimizer">true</property>
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<mapping resource="com/xzh/docsys/entity/Orgnization.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/User.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/Group.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/XzhDocument.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/File.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/SendDoc.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/ReceiveFile.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/PrintApp.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/Message.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/Popedom.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/OutSender.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/OutReceive.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/OutServer.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/OutPrintAppSend.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/OutPrintApp.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/RecPrintApp.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/RecPrintAppSend.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/ReadySendMessage.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/Part.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/PartPopedom.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/OutSenderFinish.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/GroupItems.hbm.xml"/>
<!--stampSys -->
<mapping resource="com/xzh/docsys/entity/ApplyStamp.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/SealModel.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/SealModelLog.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/Stamper.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/StamperLog.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/Check.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/DocsysLog.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/FileModel.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/FileStream.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/ModelStream.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/StampApply.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/StreamModel.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/SignList.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/OnlineMessage.hbm.xml"/>
<mapping resource="com/xzh/docsys/entity/Function1.hbm.xml"/></session-factory>
</hibernate-configuration>