You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Bruno CROS <br...@gmail.com> on 2006/02/27 15:11:28 UTC

Re: OJB CLOB Support

  Hi,

I need a little documentation on CLOB too.

To start, does someone can tell me which java type i have to use (to map)
with a jdbc-type CLOB ?

java.sql.Clob? as the OJB types mapping board shows it. but java.sql.Clob is
only an interface. What object to create so ? ( is there a Clob
implementation ?)

String (or StringBuffer)? does OJB always load all the data on queries !?
oups !

Byte[] ? as BLOB. I need some special character, only found in UNICODE.
byte[] means that content is in "bad" ASCII for me.

any other type ?

Thanks for any ligtht.


On 1/4/06, Armin Waibel <ar...@apache.org> wrote:
>
> Hi Vamsi,
>
> sorry for the late reply.
> I added an JIRA issue (maybe someone can spend time to adapt this
> section).
>
> regards,
> Armin
>
>
> Vamsi Atluri wrote:
> > Hello all,
> >
> > In our application we use OJBs extensively. However, we have a CLOB
> field
> > that needs to be populated within the application. I was trying to find
> > documentation about OJB's support for *LOB objects at this link:
> > http://db.apache.org/ojb/docu/howtos/howto-use-lobs.html
> >
> > However, all I could find was this:
> >
> > Strategy 1: Using streams for LOB I/O
> >
> > ########## to be written #########
> > Strategy 2: Embedding OJB content in Java objects
> >
> > ########## to be written #########
> > Querying CLOB content
> >
> > ########## to be written #########
> >
> >
> > Is there any documentation out there that explains these concepts?  Any
> > help is greatly appreciated. Thanks.
> >
> > Regards,
> > -Vamsi
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>

Re: OJB CLOB Support

Posted by Bruno CROS <br...@gmail.com>.
Ok

About suggestions :

Well, most of the time,  we work with ReportQuery to read Collections (those
queries don't affect only one table) . So, querying the table containing the
CLOB columns shouldn't take too much time ; i guess, at that moment, we
didn't need to read the CLOB column anyway.

So, materialization of CLOB columns is only done when mapped objects are
materialized. We take care about reading one by one (with getByIdentity
service) and not with an object query, returning a List.

But, i'm affraid of the used size of the cache ! This leads me to tell that
a good user CLOBImplementation (or user CLOBWrapper) can be inside a cached
object, (with or) without reading CLOB object. Indeed, a CLOB wrapper that
can implements java.sql.CLOB interface and can be instanciated would be
sufficient. I guess that problems will occur with Cache Implementation,
using hard references (object cloning). But why would we clone this kind of
object, since this is not a primitive type.

Am i on the rigth way ?

Regards.












On 2/28/06, Armin Waibel <ar...@apache.org> wrote:
>
> Hi Bruno,
>
> Bruno CROS wrote:
> >   Hi,
> >
> > I need a little documentation on CLOB too.
> >
> > To start, does someone can tell me which java type i have to use (to
> map)
> > with a jdbc-type CLOB ?
> >
> > java.sql.Clob? as the OJB types mapping board shows it. but
> java.sql.Clob is
> > only an interface. What object to create so ? ( is there a Clob
> > implementation ?)
> >
> > String (or StringBuffer)? does OJB always load all the data on queries
> !?
> > oups !
> >
> > Byte[] ? as BLOB. I need some special character, only found in UNICODE.
> > byte[] means that content is in "bad" ASCII for me.
> >
> > any other type ?
>
> you are right, currently the CLOB/BLOB support isn't very sophisticated
> (BLOB columns mapped to byte[], CLOB mapped to String - see
> JdbcTypesHelper class).
> Currently we think about to introduce JdbcType classes which handle the
> Clob/Blob interfaces instead of the materialized String/byte[] objects.
> Any suggestions are welcome.
>
>
> regards,
> Armin
>
>
> >
> > Thanks for any ligtht.
> >
> >
> > On 1/4/06, Armin Waibel <ar...@apache.org> wrote:
> >> Hi Vamsi,
> >>
> >> sorry for the late reply.
> >> I added an JIRA issue (maybe someone can spend time to adapt this
> >> section).
> >>
> >> regards,
> >> Armin
> >>
> >>
> >> Vamsi Atluri wrote:
> >>> Hello all,
> >>>
> >>> In our application we use OJBs extensively. However, we have a CLOB
> >> field
> >>> that needs to be populated within the application. I was trying to
> find
> >>> documentation about OJB's support for *LOB objects at this link:
> >>> http://db.apache.org/ojb/docu/howtos/howto-use-lobs.html
> >>>
> >>> However, all I could find was this:
> >>>
> >>> Strategy 1: Using streams for LOB I/O
> >>>
> >>> ########## to be written #########
> >>> Strategy 2: Embedding OJB content in Java objects
> >>>
> >>> ########## to be written #########
> >>> Querying CLOB content
> >>>
> >>> ########## to be written #########
> >>>
> >>>
> >>> Is there any documentation out there that explains these
> concepts?  Any
> >>> help is greatly appreciated. Thanks.
> >>>
> >>> Regards,
> >>> -Vamsi
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> >>> For additional commands, e-mail: ojb-user-help@db.apache.org
> >>>
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> >> For additional commands, e-mail: ojb-user-help@db.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>

Re: OJB CLOB Support

Posted by Armin Waibel <ar...@apache.org>.
Hi Bruno,

Bruno CROS wrote:
>   Hi,
> 
> I need a little documentation on CLOB too.
> 
> To start, does someone can tell me which java type i have to use (to map)
> with a jdbc-type CLOB ?
> 
> java.sql.Clob? as the OJB types mapping board shows it. but java.sql.Clob is
> only an interface. What object to create so ? ( is there a Clob
> implementation ?)
> 
> String (or StringBuffer)? does OJB always load all the data on queries !?
> oups !
> 
> Byte[] ? as BLOB. I need some special character, only found in UNICODE.
> byte[] means that content is in "bad" ASCII for me.
> 
> any other type ?

you are right, currently the CLOB/BLOB support isn't very sophisticated 
(BLOB columns mapped to byte[], CLOB mapped to String - see 
JdbcTypesHelper class).
Currently we think about to introduce JdbcType classes which handle the 
Clob/Blob interfaces instead of the materialized String/byte[] objects.
Any suggestions are welcome.


regards,
Armin


> 
> Thanks for any ligtht.
> 
> 
> On 1/4/06, Armin Waibel <ar...@apache.org> wrote:
>> Hi Vamsi,
>>
>> sorry for the late reply.
>> I added an JIRA issue (maybe someone can spend time to adapt this
>> section).
>>
>> regards,
>> Armin
>>
>>
>> Vamsi Atluri wrote:
>>> Hello all,
>>>
>>> In our application we use OJBs extensively. However, we have a CLOB
>> field
>>> that needs to be populated within the application. I was trying to find
>>> documentation about OJB's support for *LOB objects at this link:
>>> http://db.apache.org/ojb/docu/howtos/howto-use-lobs.html
>>>
>>> However, all I could find was this:
>>>
>>> Strategy 1: Using streams for LOB I/O
>>>
>>> ########## to be written #########
>>> Strategy 2: Embedding OJB content in Java objects
>>>
>>> ########## to be written #########
>>> Querying CLOB content
>>>
>>> ########## to be written #########
>>>
>>>
>>> Is there any documentation out there that explains these concepts?  Any
>>> help is greatly appreciated. Thanks.
>>>
>>> Regards,
>>> -Vamsi
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org