Hi All,
Using Oracle LOBs we came across the following issue:
When updating a LOB with less data than it contained, it keeps hold of
the old trailing data. This appears to be
"normal" Oracle behavior but nevertheless annoying. I solved this by
implementing the following OCI call:
OCILobTrim. This will trim the LOB to a given size. I have also
implemented OracleLargeObjectBuffer>>trimLobTo: length which calls the
OCILobTrim function with the correct arguments. This method might belong
on OracleLobProxy which is a subclass of OracleLargeObjectBuffer. I also
changed the OracleLobProxy>>writeFrom:with: method so it automatically
calls trimLobTo: . UnableToTrimLobData and OracleConnection
class>>unableToTrimLobData were also implemented to complete the
picture. The only problem with this implementation is that it doesn't
take multibyte characters into account. The length argument in
trimLobTo: (and the OCI call) are bytes in case of a BLOB and characters
in case of a CLOB, but now it truncates the LOB to the size of the
buffer (which might contain 1000 two-byte characters) which is 2000.
Please take a look at it and integrate it.
Cham PĆ¼schel
Soops
PS I have also posted it on VW-Dev because it contains new functionallity.