RE: [JBoss-user] WrappedConnections and Oracle Stored Procedures
Title: RE: [JBoss-user] WrappedConnections and Oracle Stored Procedures what should be done for the OracleConnection ...can we leave it as it is without closing it ? any ideas... -Original Message- From: Pedro Salazar [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 22, 2004 10:18 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] WrappedConnections and Oracle Stored Procedures On Mon, 2003-05-19 at 13:30, David Jencks wrote: > Try something like > > (OracleConnection)((WrappedConnection)wc).getUnderlyingConnection()) > > Be careful not to close the OracleConnection! > > david jencks > Isn't possible to do it but avoiding specific jboss classes hard-coded? Here I have the jboss org.jboss.resource.adapter.jdbc.WrappedConnection reference on the code which if I pretend to take my solution to another container I would to fix every specific statement. Any ideas? > On 2003.05.19 07:45 Peter Spiess wrote: > > I'm trying to execute a stored procedure within a BMP entity bean. This > > procedure uses custom types and in order to use them I need to call > > oracle.sql.ArrayDescriptor.createDecscriptor(String,Connection). When I > > do > > this within my bean a ClassCastException is thrown. My current guess is > > that this is because the Connection that I am passing ins a > > org.jboss.resource.adapter.jdbc.WrappedConnection and the Oracle driver > > is > > expecting something else. When I execute this code as just a POJO I pass > > a > > oracle.jdbc.driver.OracleConnection which does work. > > > > Maybe there's another way to handle this situation? > > > > Thanks, > > > > Peter -- -PS --- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ** This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated. **
RE: [JBoss-user] WrappedConnections and Oracle Stored Procedures
Title: RE: [JBoss-user] WrappedConnections and Oracle Stored Procedures we can avoid importing of WrappedConnection object by using java reflection api...we can pass the connection from pool to a method which uses reflection api to get the OracleConnection object from it.. here is the sample code.. /// public OracleConnection getOracleConnection( java.sql.Connection conFromPool ) throws PEException { OracleConnection oraCon = null; try { Class[] parms = null; java.lang.reflect.Method theMethod; theMethod = (conFromPool.getClass()).getMethod("getUnderlyingConnection",parms); oraCon = (OracleConnection) theMethod.invoke(conFromPool,parms); } catch (InvocationTargetException ite) { throw new PEException(ite.getMessage(),ite); } catch (Exception e) { throw new PEException(e.getMessage(),e); } return oraCon; } if we the close the OracleConnection object it will close the Connection instead of returning to the pool so, we are closing the connection object returned by pool only and leaving OracleConnection object as it is.. hope this wont create any problems...is there any other away to avoid this any ideas please share... Thanks ravinder -Original Message- From: Pedro Salazar [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 22, 2004 10:18 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] WrappedConnections and Oracle Stored Procedures On Mon, 2003-05-19 at 13:30, David Jencks wrote: > Try something like > > (OracleConnection)((WrappedConnection)wc).getUnderlyingConnection()) > > Be careful not to close the OracleConnection! > > david jencks > Isn't possible to do it but avoiding specific jboss classes hard-coded? Here I have the jboss org.jboss.resource.adapter.jdbc.WrappedConnection reference on the code which if I pretend to take my solution to another container I would to fix every specific statement. Any ideas? > On 2003.05.19 07:45 Peter Spiess wrote: > > I'm trying to execute a stored procedure within a BMP entity bean. This > > procedure uses custom types and in order to use them I need to call > > oracle.sql.ArrayDescriptor.createDecscriptor(String,Connection). When I > > do > > this within my bean a ClassCastException is thrown. My current guess is > > that this is because the Connection that I am passing ins a > > org.jboss.resource.adapter.jdbc.WrappedConnection and the Oracle driver > > is > > expecting something else. When I execute this code as just a POJO I pass > > a > > oracle.jdbc.driver.OracleConnection which does work. > > > > Maybe there's another way to handle this situation? > > > > Thanks, > > > > Peter -- -PS --- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ** This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated. **
Re: [JBoss-user] WrappedConnections and Oracle Stored Procedures
On Mon, 2003-05-19 at 13:30, David Jencks wrote: > Try something like > > (OracleConnection)((WrappedConnection)wc).getUnderlyingConnection()) > > Be careful not to close the OracleConnection! > > david jencks > Isn't possible to do it but avoiding specific jboss classes hard-coded? Here I have the jboss org.jboss.resource.adapter.jdbc.WrappedConnection reference on the code which if I pretend to take my solution to another container I would to fix every specific statement. Any ideas? > On 2003.05.19 07:45 Peter Spiess wrote: > > I'm trying to execute a stored procedure within a BMP entity bean. This > > procedure uses custom types and in order to use them I need to call > > oracle.sql.ArrayDescriptor.createDecscriptor(String,Connection). When I > > do > > this within my bean a ClassCastException is thrown. My current guess is > > that this is because the Connection that I am passing ins a > > org.jboss.resource.adapter.jdbc.WrappedConnection and the Oracle driver > > is > > expecting something else. When I execute this code as just a POJO I pass > > a > > oracle.jdbc.driver.OracleConnection which does work. > > > > Maybe there's another way to handle this situation? > > > > Thanks, > > > > Peter -- -PS --- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user