borinquenkid commented on PR #16784:
URL: https://github.com/apache/grails-core/pull/16784#issuecomment-6536478597

   Pushed commit `b5ad403736` addressing the remaining round-3 review items and 
semantic pathway hardening:
   
   1. **API & Construction Minimalism**:
      - Dropped the unused `transactionAware` field and assignment from 
`GrailsHibernateTemplate`.
      - Removed the 2-argument `executeInSession` overload and the 
`isLazyConnection()` getter.
      - Removed unused 4-argument constructors from 
`AbstractOuterSessionLifecycleStrategy`, 
`ActiveTransactionOuterSessionStrategy`, `DefaultOuterSessionStrategy`, and the 
4-argument `OuterSessionLifecycleStrategy.from` factory overload, standardizing 
on explicit `lazyConnection` configuration.
      - Updated `OuterSessionLifecycleStrategySpec` to pass `false` for the 5th 
argument.
   
   2. **Null-Safety on Transaction Resources**:
      - Guarded `dataSource` lookups with null checks before invoking 
`txResources.getResource(dataSource)`, `unbindResource`, and `bindResource` to 
prevent `IllegalArgumentException: Resource must not be null` when 
`GrailsHibernateTemplate` operates without a `DatasourceConnectionProviderImpl` 
(e.g., unit test mode or custom non-DataSource providers).
   
   3. **Cleanup & Early Failure Symmetry**:
      - Simplified `cleanupNewSession(Session)` to use 
`txResources.unbindResourceIfPossible(sessionFactory)` without catching 
`RuntimeException`, guarding against missing bindings if `openSession()` fails 
without suppressing actual closure exceptions.
      - Added `GrailsHibernateTemplateSpec` test verifying that when 
`openSession()` fails, the exception propagates cleanly and outer session 
bindings are restored symmetrically.
   
   4. **Authentic Eager Flush Exception Translation**:
      - Updated `GrailsHibernateTemplateSpec` to test authentic flush 
translation using a column length constraint on H2, verifying that 
`FLUSH_EAGER` translates length overruns to `DataIntegrityViolationException`.


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

Reply via email to