Hi,
We have ported our big application from SGWT 4.1p to 6.0p. One of the components uses file upload component. The customer filled a bug that when he uploads a file, browser freezes. Depending on the version, it freezes between 10 seconds and couple of minutes.
Finally I have chased down the issue - in 6.0p the form submission returns the binary contents of the file back in JSON response. Depending on the browser version, parsing of large JSON takes different time.
The 6.0p response looks like this (pay attention to field called fileContents, containing 500k binary data of the uploaded PNG image):
The same 4.1p response looks like this:
The Data Source declaration is the following:
The JPA Bean is also simple:
So, my question to the community is:
1. do you see the same behavior?
2. is it ok?
3. how can I switch it off?
We have ported our big application from SGWT 4.1p to 6.0p. One of the components uses file upload component. The customer filled a bug that when he uploads a file, browser freezes. Depending on the version, it freezes between 10 seconds and couple of minutes.
Finally I have chased down the issue - in 6.0p the form submission returns the binary contents of the file back in JSON response. Depending on the browser version, parsing of large JSON takes different time.
The 6.0p response looks like this (pay attention to field called fileContents, containing 500k binary data of the uploaded PNG image):
Code:
<HTML> <BODY ONLOAD='var results = document.formResults.results.value;if (!(new RegExp( "^(\\d{1,3}\\.){3}\\d{1,3}$").test(document.domain))) { while (!window.isc && document.domain.indexOf(".") != -1 ) { try { parent.isc; break;} catch (e) { document.domain = document.domain.replace(/.*?\./, "");}}} parent.isc.Comm.hiddenFrameReply(0,results)'><BR><BR><BR><BR><BR><BR><BR><BR> <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> <FORM name='formResults'><TEXTAREA readonly name='results'> //isc_RPCResponseStart-->[{affectedRows:1,data:{id:7,fileContents_filesize:153038, fileContents_filename:"2000px-Deutsches_Bildungssystem-quer.svg.png",name:"TEST", fileContents:"�PNG\r\n....<here 500k binary data>...."}, invalidateCache:false,isDSResponse:true,operationType:"add",queueStatus:0,status:0}] //isc_RPCResponseEnd </TEXTAREA></FORM> </BODY></HTML>
Code:
<HTML> <BODY ONLOAD='var results = document.formResults.results.value;if (!(new RegExp( "^(\\d{1,3}\\.){3}\\d{1,3}$").test(document.domain))) { while (!window.isc && document.domain.indexOf(".") != -1 ) { try { parent.isc; break;} catch (e) { document.domain = document.domain.replace(/.*?\./, "");}}} parent.isc.Comm.hiddenFrameReply(0,results)'><BR><BR><BR><BR><BR><BR><BR><BR><BR> <BR><BR><BR><BR><BR><BR><BR><BR><BR> <FORM name='formResults'><TEXTAREA readonly name='results'> //isc_RPCResponseStart-->[{affectedRows:1,data:{id:8,fileContents_filesize:153038, fileContents_filename:"2000px-Deutsches_Bildungssystem-quer.svg.png",name:"Test 4.1"}, invalidateCache:false,isDSResponse:true,operationType:"add",queueStatus:0,status:0}] //isc_RPCResponseEnd</TEXTAREA></FORM> </BODY></HTML>
Code:
<DataSource ID="uploadDS" serverType="jpa" jpaConfig="bgx" beanClassName="com.smg.bgx.persistence.test.TestUpload"> <fields> <field name="id" type="sequence" hidden="true" primaryKey="true" /> <field name="name" type="text" title="Name" required="false" /> <field name="fileContents_filename" type="text" title="Dateiname" required="false" /> <field name="fileContents_filesize" type="long" title="Dateigroesse" required="false" /> <field name="fileContents" type="binary" title="Upload Datei" required="false"/> </fields> </DataSource>
Code:
@Entity @Table(name="TEST_UPLOAD") @NamedQuery(name="TestUpload.findAll", query="SELECT p FROM TestUpload p") public class TestUpload implements Serializable, Cloneable { private static final long serialVersionUID = 1L; @Id @SequenceGenerator(name="TEST_UPLOAD_GENERATOR", sequenceName="TEST_UPLOAD_SEQ", allocationSize=1) @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="TEST_UPLOAD_GENERATOR") @Column(name="ID") private long id; @Column(name="NAME") private String name; @Column(name="FILE_NAME") private String fileContents_filename; @Column(name="FILE_SIZE") private long fileContents_filesize; @Column(name="FILE_CONTENTS", columnDefinition="BLOB") @Lob private byte[] fileContents; //... getters and setters }
So, my question to the community is:
1. do you see the same behavior?
2. is it ok?
3. how can I switch it off?
Comment