ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | shark List | January 2005 Index

<--  Date Index  --> <--  Thread Index  -->

Oracle BLOBs problems


Hi,

With the last CVS version of Shark, we have problems with blobs:

 

java.sql.SQLException: Row insert failed - null

        at org.enhydra.shark.instancepersistence.data.ProcessDataDO.executeInsert(ProcessDataDO.java:2278)

        at com.lutris.appserver.server.sql.standard.StandardDBTransaction.write(StandardDBTransaction.java:651)

        at com.lutris.appserver.server.sql.standard.StandardDBTransaction.commit(StandardDBTransaction.java:296)

        at org.enhydra.shark.transaction.SharkDODSTransaction.commit(SharkDODSTransaction.java:59)

        at org.enhydra.shark.SharkUtilities.commitTransaction(SharkUtilities.java:638)

        at org.enhydra.shark.SharkConnectionImpl.createProcess(SharkConnectionImpl.java:178)

 

The exception is throw when the variable value is null, if we change the OracleDriverDependencies class:

 

public void insertBlob(……

….

….

    if (cont!=null){

                qb = conn.getConnection().prepareStatement("select " + column.getColumnName() + " from " +

                rs = qb.executeQuery();

                rs.next();

                blob = ((OracleResultSet)rs).getBLOB(1);

                in = new BufferedInputStream(new ByteArrayInputStream(cont));

                out = blob.getBinaryOutputStream();

                int chunk = blob.getChunkSize();

                byte buffer[] = new byte[chunk];

                for(int length = -1; (length = in.read(buffer)) != -1;)

                    out.write(buffer, 0, length);

 

                if(blob.length() != (long)cont.length)

                    out.flush();

    }

….

….

       

 

It works.

 

Regards

Javier



<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.