尽量使用容器提供的连接池,可能要把max statement设置为零。

解决方案 »

  1.   

    是所有使用了HIBERNATE的地方都一起发生异常
      

  2.   

    对了,我用的数据库版本是mysql 4.0.18,需要什么补丁?
      

  3.   

    还有就是当hibernate不能正常运行的时候,使用JDBC直接操作的模块还能继续运行。
      

  4.   

    用hibernate访问数据库的程序、用jdbc访问数据库的程序、连接池怎么配的都发上来看看啊~
      

  5.   

    <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>
      

  6.   

    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>