geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: JCA Connector getConnection returning a Proxy
Date Tue, 14 Oct 2008 16:53:38 GMT
Hi John,

On Oct 14, 2008, at 1:54 AM, johnxmas wrote:

> Hi,
>
> I'm experiencing a problem with my ResourceAdapter: the  
> getConnection metod of my ConnectionFactory returns a Proxy instead of
> the expected Connection , causing a ClassCastException
>
> java.lang.ClassCastException: $Proxy33
> 	 
> com 
> .scort 
> .ctg 
> .cics 
> .eci 
> .jca.EciConnectionFactory.getConnection(EciConnectionFactory.java:381)
>
> Any help would be appreciated
>
> Geronimo version is 2.1.3

Someone else also found this recently, see https://issues.apache.org/jira/browse/GERONIMO-4350

The best solution, if practical for your resource adapter, is to have  
the ManagedConnections implement DissociatableManagedConnection since  
that will use the spec defined functionality for preventing connection  
leaks rather than our proxy based way.

The next best solution would be to make sure the interface the  
Connection implements has all the methods you need to call on it and  
use the interface in your client code rather than the concrete  
connection class.

Dain outlined some possible geronimo code changes to fix this, and if  
you wanted to pursue one that would be great.  I have some other work  
to finish before I can take a look.

thanks
david jencks

>
>
> Jean-Noël


Mime
View raw message