Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Disconected connection when try upload to database BLOB with size more than 1mb.

Perevertkin M AJun 26 2019 — edited Jul 2 2019

Jdeveloper version 12.2.1.3.0

WebLogic Server Version: 12.2.1.3.0

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

Hello, when i try upload in database blob with size more than 1mb i get next error:

My entity attribute and code:

Entity Attribute:

<Attribute
  Name="FilterProdValue"
  IsQueriable="false"
  ColumnName="FILTER_PROD_VALUE"
  SQLType="BLOB"
  Type="oracle.jbo.domain.BlobDomain"
  ColumnType="BLOB"
  TableName="ANALYSIS_FILTER"/>

Java code:

ApplicationModule am = ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
ViewObject vo = am.findViewObject("AnalysisFilterView1");
AnalysisFilterViewRowImpl newRow = (AnalysisFilterViewRowImpl) vo.createRow();

//main code

BlobDomain blob = new BlobDomain();

ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);

oos.writeObject(prodTreeModel.getWrappedData()); // prodTreeModel  - custom class with hierarchical data

oos.flush();
oos.close();

InputStream in = new ByteArrayInputStream(baos.toByteArray());
OutputStream out = null;

try {

  out = blob.getBinaryOutputStream();
  byte[] buffer = new byte[1024];

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

      out.write(buffer, 0, length);
   }

  in.close();
} catch (IOException e) {

  e.printStackTrace();
}

out.close();

newRow.setFilterProdValue(blob);

When i commit row, returned next error:

<oracle.adf.model> <OracleSQLBuilderImpl> <bindWhereAttrValue> <[123090] Where binding param 1: test>

<oracle.adf.model> <EntityImpl> <compare> <[123091] Entity compare failed for attribute FilterProdValue>

<oracle.adf.model> <EntityImpl> <compare> <[123092] Difference in lob values for attribute at index:1>

<oracle.adf.model> <EntityImpl> <doDMLWithLOBs> <[123093] EntityImpl.doDMLWithBlob failed...>

<oracle.adf.model> <EntityImpl> <doDMLWithLOBs> <[123094] oracle.jbo.JboException: JBO-29000: Перехвачено непредвиденное исключение: java.sql.SQLRecoverableException, сообщ.=Ошибка ввода/вывода: Удаленный хост принудительно разорвал существующее подключение

at oracle.jbo.domain.BlobDomain.writeBytesToLob(BlobDomain.java:464)

at oracle.jbo.domain.BaseLobDomain.saveToDatabase(BaseLobDomain.java:624)

More log text in attacchment.
Please, help.

This post has been answered by Sidorchuk Alexandr on Jul 2 2019
Jump to Answer
Comments
Post Details
Added on Jun 26 2019
9 comments
652 views