db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Mogley" <mmog...@hotmail.com>
Subject Re: Oracle 9i BLOB malfunction / 4k mystery
Date Fri, 09 May 2003 17:03:16 GMT
Thomas and Per-Olof,

I haven't been able to do anything on this yet.  Per-Olof, does your
solution work for updating lobs larger than 4K?  The only way I know of to
do this with the thin driver is to first issue a SELECT FOR UPDATE on the
required row, then use Oracle JDBC extension API to get an OutputStream to
the LOB and write to it.

If you've hit on another easier way to do the same, all the better, but
judging from your comments, I'm not sure this is the case.

Michael

----- Original Message ----- 
From: "Thomas Mahler" <thma32@web.de>
To: "OJB Developers List" <ojb-dev@db.apache.org>
Sent: Thursday, May 08, 2003 10:52 PM
Subject: Re: Oracle 9i BLOB malfunction / 4k mystery


> Hi again Per-Olof,
>
> Per-Olof Norén wrote:
> > Thomas, Comitters,
> >
> > The reason for my modification (as sketched below) of PlatformOracleImpl
> > was to allow for both byte[] and java.lang.String in beans that is
> > mapped to clob field.
> >
> > This is my last mod that is not handed back into ojb cvs.
> > Is the project interested in me sending a patch for this?
>
> Yes, that sounds great. I'd really apreciate a simple patch to the 4K
> problem. So I'm willing to commit your patch to CVS after reviewing it.
>
> Could you please check if your solution does work for BLOB columns too?
> If so we could put an end to this whole 4K story soon.
>
> Currently Michael Mogley is also working on patch, but from what I saw
> last time his changes had a lot of impacts to many classes apart from
> PlatformOracleImpl. So I think the best thing is to compare both
> approaches and to take the solution with the least impact on the overall
> codebase.
>
> cheers,
> Thomas
>
> > I (and our customer) would really appreciate this, since this
> > would allow us to go with OJB 1.0 rcx releases , which is desired.
> >
> > Thanx in advance,
> >
> > Per-Olof Norén
> >
> >
> > Per-Olof Norén wrote:
> >
> >> Torsten Schlabach wrote:
> >>
> >>> Peer-Olof,
> >>>
> >>>>> Am I alone using oracle for storing blobs?
> >>>
> >>> Well, we have been trying the same for CLOBs. This issue seems to be
the
> >>> same on Oracle 8.x by the way.
> >>
> >>
> >>
> >> I actually made a change to get clobs to work:
> >>
> >> public void setObjectForStatement(PreparedStatement ps, int index,
> >> Object value, int sqlType) throws SQLException
> >> }
> >> .....skipping blob and double stuff.....
> >>
> >>  else if (sqlType == Types.CLOB)
> >>         {
> >>             Reader reader = null;
> >>             int length = 0;
> >>             if(value instanceof String)
> >>             {
> >>                 reader = new StringReader((String) value);
> >>                 length = (((String) value)).length();
> >>             } else if (value instanceof byte[])
> >>             {
> >>                 byte buf[] = (byte[]) value;
> >>                 ByteArrayInputStream inputStream = new
> >> ByteArrayInputStream(buf);
> >>                 reader = new InputStreamReader(inputStream);
> >>             }
> >>
> >>             ps.setCharacterStream(index, reader, length);
> >>         }
> >>         else
> >>         {
> >>             super.setObjectForStatement(ps, index, value, sqlType);
> >>         }
> >>     }
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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