I'm trying to understand how to implement an aspect for sql connection when it is closing (to have still in the same thread active connection).
Normally when connection is established I can implement Spring ConnectionPreparer with:
@AfterReturning(execution (java.sql.Connection javax.sql.DataSource.getConnection(..), returning="connection"'
and this works, but how to bite the closing connection case ?
Can you please give me some hints ?