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 : [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to