#535 Oracle BLOB fails in JDBCUtil.setParameter for LONGVARBINARY

JBossCMP (86)

Oracle's thin JDBC driver fails in
JDBCUtil.setParameter for LONGVARBINARY when setting
BLOBs. There is a similar problem reported in 525663
but it does not address this particular concern. This
is required for Nukes BLOB file storage when using an
Oracle backend.

The attached patch offers a solution but I wonder if
there's a better way of achieving the result. In brief,
Oracle's handling of BLOBs is quite unique. This patch
detects the presence of the Oracle JDBC driver, then
sets up a routine to create an oracle.sql.BLOB object.

Since the oracle.sql.BLOB object is Oracle specific,
the build file for server gets an added classpath
dependency. I know this isn't the best place for this
but since the Oracle driver isn't part of /thirdparty,
I didn't want to mess with the buildfragments.

Also, given that the routine is in JDBCUtil, the only
way to get the underlying Oracle connection required
for oracle.sql.LOB.createTemporary(), is to expose the
managed connection in WrappedConnection.java. This is
particularly troublesome because it creates a
dependency on the "connector" module in the "server"

Anyhow, this works, but I certainly welcome a cleaner
implementation, especially with regards to satisfying
the dependence I just mentioned.

See patch for the nuts and bolts of it.


  • Marc Lavergne

    Marc Lavergne - 2004-10-31

    Oracel CMB Blob Fix against 3.2.3

  • Alexey Loubyansky

    • assigned_to: nobody --> loubyansky
    • status: open --> closed-rejected
  • Alexey Loubyansky

    Logged In: YES

    No way. We use standard JDBC to set parameters.

    What does Oracle complain about? What Oracle version? I
    don't remember any problem with this.

    The responcible for this code was refactored in post 3.2.3
    versions. There is no more setParameter method in JDBCUtil.
    This stuff is now pluggable specifically to workaround bugs
    in JDBC drivers. See

  • Stephen Coy

    Stephen Coy - 2004-10-31

    Logged In: YES

    The Oracle 10g drivers resolved this problem for LONG RAW types and I
    suspect that blobs were also fixed, although I've not tried it.

  • Marc Lavergne

    Marc Lavergne - 2004-10-31

    Logged In: YES

    The Oracle 10g drivers did not resolve this problem for
    BLOBs, the 4000 byte limit on streams remains. LONG RAWs
    haven't been an issue for some time now. I haven't looked at
    3.2.6, I'd need to test Nukes HEAD against it with a custom
    setter. I'll follow up here for anybody that stumbles on this.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks