我们正面临着c3p0连接池的问题。如果对象保持正常 保存没有blob数据,添加blob到对象然后会话保存方法失败。即使它不是异常处理程序,它直接最终阻止 其中session.flush抛出断言异常,因为新的id未分配给object。
任何人都面临这个问题。这是配置问题吗?
hibernate配置
org.hibernate.dialect.MySQL5Dialect
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.connection.SetBigStringTryClob">true</prop>
<prop key="hibernate.jdbc.batch_size">100</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.generate_statistics">false</prop>
<prop key="org.hibernate.cache.ehcache.configurationResourceName">ehcache.xml</prop>
<prop key="hibernate.max_fetch_depth">4</prop>
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory</prop>
<prop key="hibernate.c3p0.min_size">10</prop>
<prop key="hibernate.c3p0.max_size">200</prop>
<prop key="hibernate.c3p0.acquire_increment">1</prop>
<prop key="hibernate.c3p0.timeout">1800</prop>
<prop key="hibernate.c3p0.max_statements">100</prop>
<prop key="hibernate.c3p0.idle_test_period">3000</prop>
<prop key="hibernate.c3p0.validationQuery">SELECT 1</prop>
<prop key="hibernate.connection.release_mode">after_transaction</prop>
<prop key="hibernate.id.new_generator_mappings">false</prop>
<prop key="hibernate.search.default.directory_provider">filesystem</prop>
<prop key="hibernate.search.default.indexBase" >/var/lucene/indexes</prop>
由于 穆赫辛
答案 0 :(得分:0)
抓住Throwable对象和打印的堆栈跟踪。
catch( Throwable e){
e.printStackTrace();
}
得到了
java.lang.AbstractMethodError:方法com / mchange / v2 / c3p0 / impl / NewProxyPreparedStatement.setBinaryStream(ILjava / io / InputStream; J)V是抽象的 在com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.setBinaryStream(NewProxyPreparedStatement.java) 在org.hibernate.type.descriptor.sql.BlobTypeDescriptor $ 5 $ 1.doBind(BlobTypeDescriptor.java:130) at org.hibernate.type.descriptor.sql.BlobTypeDescriptor $ 2 $ 1.doBind(BlobTypeDescriptor.java:86) 在org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:73)
看来c3p0 jar文件使用旧的,Downloaded更新版本0.0.95.2版本,它工作
由于