org.hibernate.TransactionException: JDBC begin failed:
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:68)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
at com.stable.application.common.hibernate.HibernateSessionFactory.beginTransaction(HibernateSessionFactory.java:136)
at com.stable.application.common.struts.AduActionServlet.process(AduActionServlet.java:78)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at com.stable.application.common.struts.AduActionServlet.doGet(AduActionServlet.java:104)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.stable.application.common.http.filter.UserSessionFilter.doFilter(UserSessionFilter.java:57)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.stable.application.common.http.filter.RequestEncodeFilter.doFilter(RequestEncodeFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: Couldn't perform the operation getAutoCommit: You can't perform any operations on this connection. It has been automatically closed by Proxool for some reason (see logs).
at org.logicalcobwebs.proxool.WrappedConnection.invoke(WrappedConnection.java:207)
at org.logicalcobwebs.proxool.WrappedConnection.intercept(WrappedConnection.java:87)
at $java.sql.Wrapper$$EnhancerByProxool$$1cc186b6.getAutoCommit(<generated>)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
... 25 more
换了个连接池 和配置
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/nxlib?useUnicode=true&characterEncoding=utf8" />
<property name="username" value="" />
<property name="password" value="" />
<!-- Connection Pooling Info -->
<property name="maxActive" value="5" />
<property name="maxIdle" value="40" />
<property name="defaultAutoCommit" value="false" />
<!-- 连接Idle一个小时后超时 -->
<property name="timeBetweenEvictionRunsMillis" value="3600000" />
<property name="minEvictableIdleTimeMillis" value="3600000" />
</bean>
相关推荐
org.hibernate.TransactionException: JDBC rollback failed
nested exception is org.hibernate.TransactionException: JDBC rollback failed 这表明Hibernate事务回滚操作失败,导致事务不能正确回滚。 二、问题原因 该问题的主要原因是手动对数据库做了些操作,导致...
3. 原理:Hibernate底层依赖于JDBC来与数据库进行交云,但它隐藏了JDBC API的复杂性。Hibernate通过使用Session和Transaction对象来管理与数据库的交互,它还提供了一个查询语言HQL用于对象查询。Hibernate的原理还...
解决方案:检查hibernate.cfg.xml文件中的dialect属性,确保其与使用的数据库类型相匹配,例如MySQL应设置为`<property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>`。同时,确认项目...
错误九:Exception in thread "main" org.hibernate.TransactionException: nested transactions not supported 错误原因:Hibernate不支持嵌套事务,即在一个事务中开启另一个事务。这通常是由于在已经处于事务...
然而,分布式事务并非万能解决方案。正如描述中提到的,分布式事务并不能完全消除数据不一致性的风险,虽然它可以降低这种可能性。在处理大约5000万次操作时,出现了十几个错误,这样的错误率在某些情况下是可以接受...
│ hibernate.cfg.xml │ HibernateDaoImpl.java │ HibernateSessionFactory.java │ HibernateUtil.java │ JsonUtil.java │ list.txt │ log4j.properties │ messageResource_zh_CN.properties │ spring.xml ...
HibernateInterceptor HibernateJdbcException HibernateJdbcException HibernateJpaDialect HibernateJpaVendorAdapter HibernateObjectRetrievalFailureException HibernateObjectRetrievalFailureException...
### Hibernate 3.2 官方用户手册知识点详解 #### 一、概述 Hibernate 是一款开源的对象关系映射 (ORM) 工具,用于 Java 应用程序与数据库交互。它能够将 Java 对象自动持久化到关系型数据库中,从而简化了数据访问...
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <!-- 数据库连接配置 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource....
本文将深入探讨Spring AOP事务管理的核心概念、配置、以及可能遇到的问题和解决方案。 首先,我们需要理解什么是AOP。AOP是一种编程范式,用于将关注点(如日志、安全检查、事务管理)与主要业务逻辑解耦。在Spring...
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <!-- 启用基于注解的事务管理 --> <tx:annotation-driven transaction-manager=...
TransactionStatus getTransaction(TransactionDefinition definition) throws TransactionException; void commit(TransactionStatus status) throws TransactionException; void rollback(TransactionStatus ...
protected void onRun() throws TransactionException { // 在这里执行数据库操作 User user = new User().name("Jane").email("jane@example.com"); user.save(); } @Override protected void onFinish...
Spring AOP,全称Aspect Oriented Programming...同时,由于事务管理、安全检查、缓存和对象池管理等都是常见的系统性服务,Spring AOP为这些问题提供了统一的解决方案,使得我们的应用程序更加模块化和易于扩展。
3. **TransactionException.java** - 这个文件可能定义了一个自定义的异常类,用于在交易过程中捕获和处理错误或异常情况。 4. **i3package-info.java** - 这个文件通常用于提供包级别的注释,可能包含了关于这个包...
$result[0]) throw new TransactionException(PDO_ERROR_CODE, '更新用户失败', $result); }); echo_msg('注册成功'); //可以直接提交json,用下面方式接收 $newUser = request_object(); //$newUser = ...