This content has been marked as final.
Show 4 replies
-
1. Re: .. problems with clob's and oracle (ojdbc14_g)
itsme Jul 3, 2008 3:33 AM (in response to urbanj)Hi joern,
try to add the @Lob annotation to the member. We hava had the same problem and changed to the newest oracle driver (somewhat ojdbc5.jar), but I can't remember exactly what leads us to the success (will investigate more when I'm back to office next monday).
Another guess is to add a columndefinition to the @Column annotation like ... columndefinition="BLOB" ... . If all that won't work try to store the large object as chunks of byte[255] arrays, at least this will work.
Hope this gives you any hints to solve the problem.
Regards
\sandor\ -
2. Re: .. problems with clob's and oracle (ojdbc14_g)
urbanj Jul 3, 2008 7:09 AM (in response to urbanj)hi sandor,
.. thanks for your quick response.
- i switched to the ojdbc5_g.jar oracle driver,
- added this annotation,...@Entity @Table(name="TableName") @Cache(usage = CacheConcurrencyStrategy.READ_ONLY) public class ClassNamet { @Column(name="Name1") private String name1; @Column(name="Name2") private String name2; *** ** * @Lob @Column(name="Col_Clob", columnDefinition="CLOB") private Clob col_clob;
but still get the same error:12:55:27,831 WARN [JDBCExceptionReporter] SQL Error: 932, SQLState: 42000 12:55:27,831 ERROR [JDBCExceptionReporter] ORA-00932: inconsistent datatypes: expected - got CLOB
I#m also not 100% procent sure where it breaks. is it the oracle driver or is it the mapping? If u can tell me, how you solved it, that'll be perfect.
thanks a lot,
joern -
3. Re: .. problems with clob's and oracle (ojdbc14_g)
itsme Jul 7, 2008 3:11 AM (in response to urbanj)Hi Joern,
the following works at least for our project@Lob @Basic(fetch=FetchType.EAGER) @Column(name = "MESSAGE", nullable = true) private byte[] message = null;
Our environment is JBoss AS 4.2.2.GA, JDK 1.5.x, Oracle 10g. Give it a try and hopefully your response will message success.
BTW the given byte[] must be de-/serialized by some code written on your own.
\sandor\ -
4. Re: .. problems with clob's and oracle (ojdbc14_g)
gus888 Jul 10, 2008 2:22 PM (in response to urbanj)"itsme" wrote:
BTW the given byte[] must be de-/serialized by some code written on your own.
Hi Sandor,
May you share your de-/serialized codes? I googled "convert byte into string" and found many example codes, but I don't know which one is good for EJB3 byte. Thanks a lot.
Gus