db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Mahler <thm...@web.de>
Subject Re: Oracle 9i BLOB malfunction / 4k mystery (issue OJB170)
Date Thu, 15 May 2003 19:10:17 GMT
Hi all,

Torsten Schlabach wrote:
> Folks,
> 
> if I get this right, we still don't have a *real* solution to this, do we? I
> found that Per-Olof's CLOB patch for using the thin driver made it to the
> CVS, but I understand it only fixes this for text < 4 KB, right?
> 
> So first of all I thought it was a good idea to enter an issue in the bug
> database at http://scarab.werken.com/scarab/issues/id/OJB170 (which became
> OJB170).
> 
> So to me there are at two questions right now:
> 
> 1. Is this an OJB bug, an Oracle bug or both?

It's definitely a Oracle problem. such problems do not exist with any 
other known JDBC driver. it also does not exist with the OCI8 or OCI9 
drivers!

I had a chance to read the release notes of the latest Oracle 9.0.2 
fixpack. they stated that they fixed this issue!
So before changing a lot of OJB code at may be worth to look at the 
latest oracle patch level.

> 2. How do we *want* do handle this at all?

We had *a lot* of discussions on this subject. just search the mail 
archives.
In short: Michael Mogley is refactoring his initial fix to reduce the 
impacts on the wider OJB codebase.
I promised him to apply his patch and integrate it into the codebase.

> 
> What I mean is: To what column type would I map a String object that I
> except to grow very large (i.e. some dozends KB of text)?
> 
> I might map it to JDBC type CLOB which would be closest to reality but this
> will break with a class cast exception (you cannot cast a string to a
> java.sql.Clob).
> 
> If you map it to anything else such as LONGVARCHAR Oracle will not care but
> this will probably break other things.
> 
> In fact it might depend on your application what you want back in your bean
> when using a CLOB column: You either might want to get a stream you can read
> from in some other place or you might want to just get the stuff into a
> String and not care about it any more (which would make your application code much
> less Oracle specific by the way).
> 
> This is essentially two different JDBC types needed for the same type of DB
> column. Does the framework support this at all? I am wrong in any assumption?

FieldConversions should be able to handle this.

cheers,
Thomas

> Torsten
> 
> P.S.: I would like to post this as a comment in Scarab, but I did not yet
> find out how to edit the issue. I was able to submit it though. Any help
> appreciated.
> 
> Original Message:
> -----------------
> From: Thomas Poeschmann t.poeschmann@exxcellent.de
> Date: Mon, 12 May 2003 16:05:08 +0200
> To: ojb-dev@db.apache.org
> Subject: Re: Oracle 9i BLOB malfunction / 4k mystery
> 
> 
> Hi there,
> 
> 
>>Michael Mogley wrote:
>>Thomas Poeschmann says on the list that he almost has a solution,
>>using the above method I presume.
> 
> 
> Yes, of course using the SELECT FOR UPDATE. Sorry for promising posting code
> but not doing it, but I will try to find it this evening. It is probably
> just 
> for reference for you, since you already have it.
> 
> 
>>Are there other dbmses and drivers that exhibit the same irregular 
>>behavior regarding LOBĀ“s.
> 
> 
> Not that I know. Sometimes it is different to call one of the methods on a
> statement to bring certain Java objects in. For example passing an array in
> as
> a String. But I have never seen anything hard as Oracle XLOBs ;)
> 
> 
>>Unfortunatly, our solution (apart from the the fix submitted) currently 
>>consists of changing to the oci driver. Sad but true.
> 
> 
> Which has other drawbacks, but well... Other ORM can not handle it either
> with
> thin, by the way ;)
> 
> Kind regards,
> 
> Thomas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 


Mime
View raw message