First, sorry for my poor english..
I searched forum for my problems but I can't find exact answers, so questioning here with big decision(english grammer problem).
I have an application which runs on:
- two Oracle 8i 8.1.7(also diffrent server)
- jdk 1.4.2
- Hibernate 3.1.2
- multi-thread env.
- java.util.concurrent package backport version for jdk 1.4
- no framework - get data from db, modify it, insert to db..It's all.
Problem 1 - when get orcale long type data from db1 bad packet error occured.
We began oracle stored procedure but it has limit to 32267 for long data type. So, decise get data using hibernate.
Code:
list mapDataList = session1.createSQLQuery(strSql2).addScalar("data", Hibernate.TEXT).list();
Following is log captured.
Code:
WARN 15:11:06 StatementUtils.attemptClose:48 - Statement close FAILED.
java.sql.SQLException: Io exception: Bad packet type
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
at oracle.jdbc.driver.OracleStatement.freeLine(OracleStatement.java:3482)
at oracle.jdbc.driver.PhysicalConnection.needLine(PhysicalConnection.java:2335)
at oracle.jdbc.driver.OracleStatement.alwaysOnClose(OracleStatement.java:1491)
at oracle.jdbc.driver.OraclePreparedStatement.alwaysOnClose(OraclePreparedStatement.java:10929)
at oracle.jdbc.driver.OracleStatement.hardClose(OracleStatement.java:1436)
at oracle.jdbc.driver.OracleStatement.hardClose(OracleStatement.java:1424)
at oracle.jdbc.driver.OraclePreparedStatement.hardClose(OraclePreparedStatement.java:10888)
at oracle.jdbc.driver.OracleStatement.closeOrCache(OracleStatement.java:1413)
at oracle.jdbc.driver.OracleStatement.close(OracleStatement.java:1342)
at com.mchange.v1.db.sql.StatementUtils.attemptClose(StatementUtils.java:41)
at com.mchange.v2.c3p0.stmt.GooGooStatementCache$1StatementCloseTask.run(GooGooStatementCache.java:327)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
WARN 15:11:06 JDBCExceptionReporter.logExceptions:71 - SQL Error: 17002, SQLState: null
ERROR 15:11:06 JDBCExceptionReporter.logExceptions:72 - Io exception: Socket closed
Our long type data size is nomally 1000~80000. Average size is about 30000.
ocassionally bad packet type error occured. we assumed the reason is data size. but, small size data also occure the same error.
especially when many thread queued concurrently and cpu busy time. error occured more than normal.
Problem 2 - when inserting clob, no error, but null inserted.
Code:
String longData = (String)mapDataList.get(0);
clobDataObject.setData( Hibernate.createClob( longData));
session2.update( clobDataObject);
We checked the data size(longData.size()). it was always over zero.
And trasaction complete without error. but, in database correspond clob field value is null.
But, it is not always null. sometimes whole data successfully inserted.
sometimes null data inserted! for same string data!
Problem 3 - OutOfMemoryError
another object runs successfully.
but, about 2 hours after following error occures.
Code:
java.lang.OutOfMemoryError
at oracle.sql.CLOB.getSubString(CLOB.java:245)
at org.hibernate.lob.SerializableClob.getSubString(SerializableClob.java:73)
at ........xxxinstanceName.run(xxx.java:212)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:534)
In above line (xxx.java:212) source code is
Code:
clobObj.getData().getSubString(1L, (int)clobObj.getData().length()));
How can i fix these problems?
Can anyone help us?
Very very thanks in advance.