-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: c3p0 and Oracle Blob
PostPosted: Thu May 13, 2004 12:14 pm 
Beginner
Beginner

Joined: Mon Nov 24, 2003 11:47 am
Posts: 22
There is problem with using c3p0 and Blob. For blob I use code:

oracle.sql.BLOB oraBlob = oracle.sql.BLOB.createTemporary(
session.connection(), false,oracle.sql.BLOB.DURATION_SESSION);

This row throws ClassCastException (probably conection is not OracleConnection() obejct). Has anybody experience with some connection pool and Blob objects in Hibernate ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 28, 2004 5:15 pm 
Proxool Developer
Proxool Developer

Joined: Tue Aug 26, 2003 10:42 am
Posts: 373
Location: Belgium
The problem is likely due because the connection served by the pool is not the *real* connection but a proxy to it.

Drop 3P0 and use Proxool instead. In its current version, Proxool gives you access to the *real* connection so you can cast it to the Oracle one and get access to any vendor extensions.


Code:
Connection c = session.getConnection();
OracleConnection realConnection = (OracleConnection)ProxoolFacade.getDelegateConnection(c);

.. then do something on the OracleConnection


In its upcoming release, things will even be easier since the proxied connection returned by proxool will implement not only the java.sql.Connection interface but *all* interfaces implemented by the *real* connection.

Therefore, if the OracleConnection is actually an interface, your code could become:

Code:
OracleConnection c = (OracleConnection) session.getConnection();

... then do something with the OracleConnection


Cool, isnt'it ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.