Hi,

we do not use LONG RAW, but only LONG. As you say you want to store a long _string_, 
LONG might be sufficient for you. It works fpr us under following constraints:
- LONG (also LONG RAW) must be the last column in the table (Oracle)
- you only may have one LONG oder LONG RAW column in one tabel (Oracle)
- set batch-mode="false" in repository
- get the latest ConnectionManagerImpl from CVS (see posting from 

The last two points should be a good idea for LONG RAW, too, and are acording to 
yesterday's posting attached below.

Although not an exact answer to your question, i hope that helps.

regards
Max


> -----Urspr�ngliche Nachricht-----
> Von: Farnea Massimiliano [mailto:[EMAIL PROTECTED]
> Gesendet: Mittwoch, 26. M�rz 2003 10:24
> An: ojb-user
> Betreff: Problem with storing in a LONG RAW field
> 
> 
> Hi,
> 
> I need to store a String that could be very long, so I 
> decided to map it on
> a LONG RAW Oracle field.
> 
> The Java bean attribute is a String and is named 'riassunto'.
> The Oracle table field is a LONG RAW name TXT_RIASSUNTO
> 
> I used the following mappings:
> 
> 1)
> I put in the repository.xml the mapping:
> 
> ...
> <field-descriptor 
>          name="riassunto"
>          column="TXT_RIASSUNTO"
>          jdbc-type="LONGVARBINARY"
>  
> conversion="org.apache.ojb.broker.accesslayer.conversions.Obje
> ct2ByteArrFiel
> dConversion"
> />
> ...
> 
> when I try to persist/update my bean I got the exception:
> 
> java.lang.NoSuchFieldException 
>       at java.lang.Class.getField0(Native Method)     
>       at java.lang.Class.getDeclaredField(Class.java:1113)
>       .......
> 
> and I found some bytes stored in the Oracle field that seems to be
> meaningless.
> 
> 2) without the conversion, I got a:
> 
> java.sql.SQLException: java.lang.ClassCastException: java.lang.String
> 
> 
> 3) using an attribute type byte[] instead of String and the mapping:
> 
> <field-descriptor 
>          name="riassunto"
>          column="TXT_RIASSUNTO"
>          jdbc-type="LONGVARBINARY"
>  
> conversion="org.apache.ojb.broker.accesslayer.conversions.Obje
> ct2ByteArrFiel
> dConversion"
> />
> 
> I got,
> 
> java.lang.NoSuchFieldException        
>       at java.lang.Class.getField0(Native Method)     
>       at java.lang.Class.getDeclaredField(Class.java:1113)
> 
> 
> 4) Finally storing a byte[] without the conversion I got:
> 
> java.lang.NoSuchFieldException        
>       at java.lang.Class.getField0(Native Method)     
>       at java.lang.Class.getDeclaredField(Class.java:1113)
> 
> and I found the attribute value stored in HEX format !
> 
> 
> How can I do a clean storing, without errors and exceptions?
> Where can I find working examples about storing in LONG RAW?
> 
> Thanks in advance,
> 
> Massimiliano Farnea
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to