Skip to content

Fix @ProfileConnection stack trace starting with a Spring AOP frame - #295

Merged
jeanbisutti merged 1 commit into
quick-perf:masterfrom
jeanbisutti:fix-profile-connection-spring-aop-frame
Oct 22, 2026
Merged

jeanbisutti merged 1 commit into
quick-perf:masterfrom
jeanbisutti:fix-profile-connection-spring-aop-frame

Conversation

@jeanbisutti

Copy link
Copy Markdown
Collaborator

With @ProfileConnection(displayStackTrace = true) in a Spring test, the stack trace of DataSource.getConnection() should start at the DataSource element, followed by the code that gets the connection. With Spring 5.2 to 6.1, it started with a Spring AOP element.

For example, a Spring Boot 3.2.5 test (Spring 6.1.6, JDK 17) printed this (connection id replaced):

connection id - javax.sql.DataSource.getConnection()
	org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:720)
	com.zaxxer.hikari.HikariDataSource$$SpringCGLIB$$0.getConnection(<generated>)
	org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)

With the fix:

connection id - javax.sql.DataSource.getConnection()
	com.zaxxer.hikari.HikariDataSource$$SpringCGLIB$$0.getConnection(<generated>)
	org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)

@jeanbisutti
jeanbisutti merged commit 589913c into quick-perf:master Oct 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant