Skip to content

HibernateException is thrown during borrow connection after any query execution in RowMapper [SPR-7393] #12051

@spring-projects-issues

Description

@spring-projects-issues

Andruschuk Borislav opened SPR-7393 and commented

We have some DAO which call an other DAO in RowMapper to get linked entities. Sometimes we have to do that to link different loosely coupled entities in depends of included application modules, data base state etc. After migration from Spring 2.5.6 to Spring 3.X we've got the following issue:

org.hibernate.HibernateException: connnection proxy not usable after transaction completion
	at org.hibernate.jdbc.BorrowedConnectionProxy.invoke(BorrowedConnectionProxy.java:66)
	at $Proxy6.prepareStatement(Unknown Source)
	at org.springframework.jdbc.core.PreparedStatementCreatorFactory$PreparedStatementCreatorImpl.createPreparedStatement(PreparedStatementCreatorFactory.java:245)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:580)

It happens on prepared statement creation for query need to be executed after execution any SQL statement in DAO called from RowMapper. I've created Unit test to show this incident.


Affects: 3.0 GA, 3.0.1, 3.0.2, 3.0.3

Attachments:

Issue Links:

  • SEC-1778 MutableAclService#updateAcl() fails in JPA environment ("is duplicated by")

Referenced from: commits b261d33

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)in: dataIssues in data modules (jdbc, orm, oxm, tx)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions