---------- Forwarded message ----------
Date: Thu, 4 Dec 2003 07:58:15 +0000 (GMT)
From: Bruce Snyder <[EMAIL PROTECTED]>
To: SYLVIE PALLUEL <[EMAIL PROTECTED]>
Subject: Re: RE : [castor-dev]Pb while Storing BLOB to Oracle Database

This one time, at band camp, SYLVIE PALLUEL said:

SP>I've just tried this ( why not !!!)
SP>      <field name="fichier" type="bytes">
SP>        <sql type="oracle.sql.BLOB" dirty="ignore" />
SP>        <bind-xml name="fichier" />
SP>      </field>
SP>
SP>And I obtained ... Of course ... This :
SP>
SP>     [java] [testCastor]        at
SP>org.apache.tools.ant.Main.main(Main.java:235)
SP>     [java] [testCastor] org.exolab.castor.mapping.MappingException: The
SP>SQL type oracle.sql.BLOB is not supported in this release
SP>     [java] [testCastor]        at
SP>org.exolab.castor.jdo.engine.SQLTypes.typeFromName(SQLTypes.java(Inlined
SP>Compiled Code))
SP>     [java] [testCastor]        at
SP>org.exolab.castor.jdo.engine.JDOMappingLoader.getTypeInfo(JDOMappingLoad
SP>er.java(Compiled Code))
SP>
SP>
SP>Is there a way to add a special type oracleBlob ?
SP>
SP>Or do you think I have make a mistake somewhere?

Sylvie, 

Castor will properly persist a java.sql.Blob, but not an oracle.sql.BLOB.
Because it has no previous knowledge of an oracle.sql.BLOB, it has no idea
how to handle it. Castor will not handle the persistence of any types
that do not exist in the org.exolab.castor.jdo.engine.SQLTypes class as
a TypeConverter. You can add custom types to this class, but it's not
very easy to maintain moving forward. I suggest using the java.sql.Blob
as I've used it since Oracle8i with success. I suggest following the tests
available in src/tests/jdo. Take a look at the object mapping. Also see: 

    http://www.castor.org/types.html#BLOB-and-CLOB-Types

In the future, I hope to make it easier to add new types in a clean and
pluggable manner. 

Bruce
-- 
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

The Castor Project 
http://www.castor.org/

Apache Geronimo 
http://incubator.apache.org/projects/geronimo.html

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to