You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Brad Matlack <bm...@workzen.userworld.com> on 2004/02/26 23:36:14 UTC

Oracle Blob socket write error and autoCommit(true) failed

Help!

I'm trying to insert a small binary byte[] into Oracle 8.1.6. The stack 
dump provides three clues:
1: socket write error
2: could not build statement
3: set autoCommit(true) failed.

I've tried both VARCHARBINARY and BLOB in my deployment descriptor, with 
and without the conversion:
<field-descriptor
        name="token"
        column="token_data" jdbc-type="BLOB"
        
conversion="org.apache.ojb.broker.accesslayer.conversions.Object2ByteArrFieldConversion"    
   
       /> 

Any ideas?????
Thanks!
Brad


[org.apache.ojb.broker.accesslayer.StatementsForClassImpl] ERROR: Io 
exception: Software caused connection abort:
socket write error
java.sql.SQLException: Io exception: Software caused connection abort: 
socket write error
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:211)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:324)
        at 
oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:445)
        at 
oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:460)
[org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: 
PersistenceBrokerException during the execution of the insert:
Could not build statement ask for
org.apache.ojb.broker.PersistenceBrokerSQLException: Could not build 
statement ask for
        at 
org.apache.ojb.broker.accesslayer.StatementManager.getInsertStatement(Unknown 
Source)
        at 
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(Unknown 
Source)
        at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source)
        at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
        at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
        at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source)
[org.apache.ojb.broker.platforms.PlatformDefaultImpl] ERROR: Set 
autoCommit(true) failed
ERROR: Set autoCommit(true) failed
Io exception: Software caused connection abort: socket write error
java.sql.SQLException: Io exception: Software caused connection abort: 
socket write error
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:211)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:324)
        at 
oracle.jdbc.driver.OracleConnection.setAutoCommit(OracleConnection.java:812)
        at 
com.p6spy.engine.spy.P6Connection.setAutoCommit(P6Connection.java:189)


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Oracle Blob socket write error and autoCommit(true) failed

Posted by Martin Kalén <ma...@curalia.se>.
Nicolas Arni-Bloch wrote:

> I have try to deal with LOB and OJB but they are a of documentation.
> The oracle LOB are pointer to the value, therefor with JDBC you can not  
> make a classic insert. The procedure to insert a LOB as 3 phases :
> 1) insert a record with empty_blob() or empty_clob()
> 2) make a select for update  and call the getBlob() to obtain the  
> oracle.sql.BLOB
> 3) write or read with input/outputStream

Check out the Oracle9i platform implementation, which has got this stuff
incorporated. CLOB and BLOB objects of large sizes can be used with OCI or
THIN drivers for Oracle9i servers.

Batched mode only works with OCI (which unfortunately leaks memory beyond
usability on some Linux 2.4 kernels).

I have just caught up with this list after some weeks absence and have
seen some issues posted with the current Oracle9i platform driver:
* reflection lookups in managed environments fail
* possible issues with connection handling when concurrent thread access
   to LOB-data occurs
* Oracle10 JDBC-driver compatibility not implemented

None of these issues should be huge development efforts, but I am personally
working on other projects and tight on time for free-time development.
(But I would like to get a stab at this as soon as possible.)
Unfortunately there doesn't seem to be a huge number of OJB developers
with an Oracle server installation at hand, so development can be a bit slow
at times - please contribute all you can.

Regards,
  Martin

-- 
Martin Kalén
Curalia AB              Web:  http://www.curalia.se
Orrspelsvägen 2B        Mail: info@curalia.se
SE-182 79  Stocksund    Tel:  +46-8-410 064 40

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Oracle Blob socket write error and autoCommit(true) failed

Posted by Nicolas Arni-Bloch <ni...@cui.unige.ch>.
Le 26 févr. 04, à 23:36, Brad Matlack a écrit :

> Help!
>
> I'm trying to insert a small binary byte[] into Oracle 8.1.6. The  
> stack dump provides three clues:
> 1: socket write error
> 2: could not build statement
> 3: set autoCommit(true) failed.
>
> I've tried both VARCHARBINARY and BLOB in my deployment descriptor,  
> with and without the conversion:
> <field-descriptor
>        name="token"
>        column="token_data" jdbc-type="BLOB"
>         
> conversion="org.apache.ojb.broker.accesslayer.conversions.Object2ByteAr 
> rFieldConversion"            />
> Any ideas?????
> Thanks!
> Brad
>
>
> [org.apache.ojb.broker.accesslayer.StatementsForClassImpl] ERROR: Io  
> exception: Software caused connection abort:
> socket write error
> java.sql.SQLException: Io exception: Software caused connection abort:  
> socket write error
>        at  
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
>        at  
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:211)
>        at  
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:324)
>        at  
> oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:445)
>        at  
> oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:460)
> [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR:  
> PersistenceBrokerException during the execution of the insert:
> Could not build statement ask for
> org.apache.ojb.broker.PersistenceBrokerSQLException: Could not build  
> statement ask for
>        at  
> org.apache.ojb.broker.accesslayer.StatementManager.getInsertStatement(U 
> nknown Source)
>        at  
> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(Unknown  
> Source)
>        at  
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown  
> Source)
>        at  
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
>        at  
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
>        at  
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown  
> Source)
> [org.apache.ojb.broker.platforms.PlatformDefaultImpl] ERROR: Set  
> autoCommit(true) failed
> ERROR: Set autoCommit(true) failed
> Io exception: Software caused connection abort: socket write error
> java.sql.SQLException: Io exception: Software caused connection abort:  
> socket write error
>        at  
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
>        at  
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:211)
>        at  
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:324)
>        at  
> oracle.jdbc.driver.OracleConnection.setAutoCommit(OracleConnection.java 
> :812)
>        at  
> com.p6spy.engine.spy.P6Connection.setAutoCommit(P6Connection.java:189)


Hi Brad,
2 weeks ago I write a email to now how to use oracle LOB with OJB, the  
only answer was something with torque.
I have try to deal with LOB and OJB but they are a of documentation.
The oracle LOB are pointer to the value, therefor with JDBC you can not  
make a classic insert. The procedure to insert a LOB as 3 phases :
1) insert a record with empty_blob() or empty_clob()
2) make a select for update  and call the getBlob() to obtain the  
oracle.sql.BLOB
3) write or read with input/outputStream

This technic is nice when you want to insert a very large file up to  
4GB because you can not store the file in memory.
But when you just want to store data that are just more then 4kb and  
are in memory, the procedure is a little bit heavy.
What I don't understand in OJB is :
what must be the type of the attribute that we want to insert in the  
LOB is can not be java.sql.Blob because it's a interface.
it can be a byte[] but it's nice for small data. Then it must be a  
input or a output Stream, or some think that encapsulate it.

To answer to the ERROR: Set autoCommit(true) normally when you write a  
LOB the autoCommit have to be set to false. So...

I don't realy answer your problem but is just because I think that OJB  
and LOB are really not clear. I think that the OJB team have to give a  
clear answer about LOB. Either we can use LOB with OJB and a some  
documentation would be greate, or we can not now use it. And we found a  
other way.
If you or some body have some doc or howto about LOB and OJB, I will be  
happy to have it.


Cheers


--
Nicolas Arni-Bloch               						
Groupe MATIS, Centre Universitaire d'Informatique
24 rue General-Dufour
CH-1204 Genève
eMail : nicolas.arni-bloch@cui.unige.ch


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org