Hi @ll,
I have a serious problem with Hibernate. We are running through all entries in a specific table on an Oracle DB and read the contained BLOB fields. The application is running fine until the application has to reconnect to the database (network problems, etc...) ... after the reconnection we are not able to read the blobs anymore. All other objects are fine and we can even read the other fields from the same object except the blob field.
Versions:
Hibernate Version: 3.2.5.ga
C3P0 Version: 0.9.1.2
OJDBC: 10.2.0.3
DB: Oracle 10g
Hibernate Config:
hibernate.connection.username=xxx
hibernate.connection.url=jdbc:oracle:thin:@dbserver3:1521:dball10g
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
hibernate.connection.password=xxx
hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver
hibernate.show_sql=true
hibernate.c3p0.min_size=1
hibernate.c3p0.max_size=2
hibernate.c3p0.max_statements=50
hibernate.c3p0.timeout=1800
hibernate.c3p0.idle_test_period=20
hibernate.c3p0.acquire_increment=2
hbm.xml:
Code:
[...]
<property name="data" type="blob">
<column name="DATA"/>
</property>
[...]
Exception:
12:34:09 [APPLICATION] [DBAreaDataSynchronisator] [FATAL] Es trat ein Fehler beim Abfragen der Daten aus der Datenbank auf. com.desoft.log.DEException: Es trat ein Fehler beim Abfragen der Daten aus der Datenbank auf.
at com.desoft.log.DEException.createFatalException(DEException.java:74)
at com.desoft.fccbvis.jobController.synchronisation.DBAreaDataSync.doSynchronisation(DBAreaDataSync.java:114)
at com.desoft.fccbvis.jobController.synchronisation.DBSynchronisator.doSynchronization(DBSynchronisator.java:178)
at com.desoft.fccbvis.jobController.synchronisation.DBSynchronisator.run(DBSynchronisator.java:137)
at java.lang.Thread.run(Thread.java:534)
java.sql.SQLException: Closed Connection
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:208)
at oracle.sql.BLOB.getDBAccess(BLOB.java:955)
at oracle.sql.BLOB.length(BLOB.java:155)
at org.hibernate.lob.SerializableBlob.length(SerializableBlob.java:31)
at com.desoft.fccbvis.jobController.synchronisation.DBAreaDataSync.doSynchronisation(DBAreaDataSync.java:80)
at com.desoft.fccbvis.jobController.synchronisation.DBSynchronisator.doSynchronization(DBSynchronisator.java:178)
at com.desoft.fccbvis.jobController.synchronisation.DBSynchronisator.run(DBSynchronisator.java:137)
at java.lang.Thread.run(Thread.java:534)
Code:
Code:
TAreaDataGroup currentAreaGroup = (TAreaDataGroup)areaGroups.get(groupIndex);
System.out.println(currentAreaGroup.toString());
TAreaDataBlobDAO areaDataBlob = BVISDAOFactory.getInstance().getAreaDataBlobDAO();
List areaDataBlobs = areaDataBlob.findDataBlobFromGroup(currentAreaGroup, m_Type);
for(int dataIndex = 0; dataIndex < areaDataBlobs.size(); dataIndex++)
{
try
{
TAreaDataBlob currentAreaDataBlob = (TAreaDataBlob)areaDataBlobs.get(dataIndex);
InputStream inputStream = new ByteArrayInputStream(currentAreaDataBlob.getData().getBytes((long)1,
(new Long(currentAreaDataBlob.getData().length())).intValue()));
[...]
We also tried:
InputStream inputStream = currentAreaDataBlob.getData().getByteStream();
... with the same result ...
I hobe someone can help me!
THX!