[Persistence, JBoss/CMP, Hibernate, Database] - Problem using blobs with hibernate on jboss 3.2.x
by ulfreich
Hi, I'm using hibernate 2.1.8 to persist some blobs in an oracle 9i database. For this, I implemented something similar to what says in the hibernate wiki, http://www.hibernate.org/73.html, mapping a Blob to a char[]. I tested this on Jboss 4.0.3SP1 and works perfectly, but on JBoss 3.2.8SP1 it fails. The error happens when Hibernate calls the method that converts the blob to a char[], nullSafeSet(), on the line:
oracle.sql.BLOB blob = oracle.sql.BLOB.createTemporary(
| ((org.jboss.resource.adapter.jdbc.WrappedConnection)st.getConnection()).getDelegate(),
| false, oracle.sql.BLOB.DURATION_SESSION);
In this line, a temporary oracle blob gets created from the database connection asociated to the java.sql.PreparedStatement "st" created by Hibernate. The method should receive a java.sql.Connection object and, since hibernate uses a jboss datasource, the connection's class results to be org.jboss.resource.adapter.jdbc.WrappedConnection. This caused a ClassCastException. To get it working, I had to call WrappedConnection.getUnderlyingConnection(); this returns a oracle.jdbc.OracleConnection which in turn implements java.sql.Connection, so it should be accepted. As I said before, this works on Jboss 4.x, but on Jboss 3.2.x it keeps throwing a ClassCastException!
Does anyone know how can I get this to work on 3.2.x, since it works in later versions? Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965931#3965931
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965931
19 years, 8 months
[JBoss Seam] - Re: Is there a workable version of JBossSEAM?
by VotTak
"chuckadams" wrote :
| |
| | * Create the src directory then run scaffold-wtp-project. If you don't have it first, it won't complete.
| |
That is what I did. And compilation was "SUCCESSFULL"
But this is what was wrong after that:
"VotTak" wrote :
| Next.
| After issuing "seam scaffold-wtp-project sample" it looks for "src" directory under C:\seam-workspace\jboss-seam-1.0.1.GA\seam-gen
| and if it is missing build fails. Well I made it happy when I add empty "src" dir there. It did not use it, so why is that directory required?
|
| Next difference I notice when I tried to follow the guide to change build path and library dependencies.
| On the picture I saw "JBOSS 4.0" library... which is missing in my project. Should I add J2EE 1.4 library(JBOSS-IDE)?
|
| Besides, When I click on "Add JARs..." I got "JAR selection" window which has red cross and "No entries available".
| Besides, I looked in "sample" directory and it does not contain "lib" directory.
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965928#3965928
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965928
19 years, 8 months