[ 
https://issues.apache.org/jira/browse/DBCP-593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17793641#comment-17793641
 ] 

Gary D. Gregory commented on DBCP-593:
--------------------------------------

[~ralaoui] 

What is the actual issue? You write about Hibernate but it is not in the stack 
trace.

Would you provide a failing test as a PR on GitHub so we can concretely see 
what you are reporting?

> On Connection interaction failure, InvocationTargetException hides 
> SQLException
> -------------------------------------------------------------------------------
>
>                 Key: DBCP-593
>                 URL: https://issues.apache.org/jira/browse/DBCP-593
>             Project: Commons DBCP
>          Issue Type: Bug
>            Reporter: Réda Housni Alaoui
>            Priority: Major
>
> For example, interacting with a closed Postgres Connection leads to this kind 
> of stacktrace:
> {code:java}
> Caused by: java.lang.reflect.InvocationTargetException
>       at 
> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
>       at java.base/java.lang.reflect.Method.invoke(Method.java:580)
>       at 
> org.apache.commons.pool2.proxy.BaseProxyHandler.doInvoke(BaseProxyHandler.java:79)
>       at 
> org.apache.commons.pool2.proxy.JdkProxyHandler.invoke(JdkProxyHandler.java:50)
>       ... 100 more
> Caused by: org.postgresql.util.PSQLException: This connection has been closed.
>       at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:907)
>       at org.postgresql.jdbc.PgConnection.rollback(PgConnection.java:914)
>       at 
> org.apache.commons.dbcp2.DelegatingConnection.rollback(DelegatingConnection.java:781)
>       at 
> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
>       ... 103 more
> {code}
> ORMs like Hibernate expect {{SQLException}} but find themselves interacting 
> with an {{InvocationTargetException}} .



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to