borinquenkid opened a new pull request, #16784: URL: https://github.com/apache/grails-core/pull/16784
Fixes #16783. Port of #16763 to grails-data-hibernate5 on 7.0.x. ### Changes - Pre-acquire outer session physical connection before entering `executeWithNewSession`, ensuring that lazy-loaded associations on entities managed by the outer session do not borrow an inner transaction's connection. - Register a `TransactionSynchronization` at `SESSION_SYNCHRONIZATION_ORDER` (-100) when synchronization is active to disconnect the session prior to Spring's JDBC `ConnectionSynchronization` cleanup (order 1000). - Fall back to `SessionFactoryUtils.convertHibernateAccessException` when `convertJdbcAccessException` returns `null` in `convertHibernateAccessException`. - Promote `isTransactional` in `GrailsDataHibernate5TckManager` to an instance property to support testing non-transactional OSIV request sessions. - Add test coverage in `WithNewSessionLazyLoadSpec` and `GrailsHibernateTemplateSpec`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
