Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    FileItem won't upload file to Oracle datasource

    I'm currently using gwt 2.3 and smartclient power 2.5 nightly. I am following the example in the smartclient showcase for uploading a file using the FileItem. The oracle table has a field called File_CONTENTS that is a BLOB, and in my data source I have it marked as type="binary" and hidden="true". I added the _date_created, _filesize & _filename columns to the table. This is the error I get:
    Code:
     
    === 2011-10-05 14:43:05,288 [l0-7] WARN  Validation - [builtinApplication.AttachedFileDataSource_add] No such type 'binary', not processing field value at /AttachedFileDataSource/FILE_CONTENTS
    Here is my java code:
    Code:
     
    // create the form that will be used to upload any addendum
    // and set the data source for it
    final DynamicForm uploadForm = new DynamicForm();
    				uploadForm.setDataSource(						DataSource.getDataSource(RELATED_DATA_SOURCE_NAME));
    
    // create the file item to allow the user to select the
    // file to be uploaded
    FileItem theFile = new FileItem(FILE_CONTENTS, 
    						ADD_ATTACHMENT);
    
    // create the button item to commit the file upload
    				ButtonItem upload = new ButtonItem(UPLOAD, UPLOAD);
    
    // add the clickhandler to the button item to perform
    				// the upload to the database
    				upload.addClickHandler(new 
    						com.smartgwt.client.widgets.form.fields.events.ClickHandler()
    				{
    
    					/**
    					 * when the upload button is clicked the smartgwt framework 
    					 * will make and rpc and save the file to the PQD 
    					 */
    					@Override
    					public void onClick(
    							com.smartgwt.client.widgets.form.fields.events.ClickEvent event) 
    					{
    						uploadForm.saveData(
    								new com.smartgwt.client.data.DSCallback() 
    						{
    
    							@Override
    							public void execute(DSResponse response,
    									Object rawData, DSRequest request) 
    							{
    								uploadForm.editNewRecord();								
    							}
    							
    						});
    					}
    					
    				});
    
    // add the fields to the dynamic form
    uploadForm.setFields(Id, theFile, upload,
    modTimestamp);
    This is what my datasource looks like:
    Code:
     
    <field name="FILE_CONTENTS" type="binary" hidden="true"/>
    <field name="MOD_TIMESTAMP" type="modifiertimestamp" length="11" hidden="true"/>
    Also, the insert statement fails b/c the MOD_TIMESTAMP field is null. How do I tell the add operation to auto generate a timestamp on insertion? I tried adding the field to the dynamicform that the upload button is on but it still was not included in the insert statement. Do I have to override the add operation binding? If so, can you give me an example?

    #2
    Can you show the complete server log for the request? This is always needed for server issues.

    Comment


      #3
      Code:
      === 2011-10-06 17:11:45,299 [0-26] INFO  RequestContext - URL: '/project/sc/IDACall', User-Agent: 'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.20) Gecko/20110803 Firefox/3.6.20': Moz (Gecko) with Accept-Encoding header
      === 2011-10-06 17:11:45,377 [0-26] DEBUG XML - Parsed XML from (in memory stream): 73ms
      === 2011-10-06 17:11:45,384 [0-26] DEBUG RPCManager - Processing 1 requests.
      === 2011-10-06 17:11:45,387 [0-26] DEBUG RPCManager - Request #1 (DSRequest) payload: {
          values:{
              attachment_CONTENTS:"attributemap.xml",
              REPORT_ID:1,
              _transaction:null,
              attachment_CONTENTS_date_created:new Date(1317921105385),
              attachment_CONTENTS_filesize:286,
              attachment_CONTENTS_filename:"attributemap.xml"
          },
          operationConfig:{
              dataSource:"ReportattachmentDataSource",
              operationType:"add"
          },
          componentId:"isc_DynamicForm_3",
          appID:"builtinApplication",
          operation:"ReportattachmentDataSource_add",
          oldValues:{
          },
          criteria:{
          }
      }
      === 2011-10-06 17:11:45,387 [0-26] INFO  IDACall - Performing 1 operation(s)
      === 2011-10-06 17:11:45,388 [0-26] DEBUG AppBase - [builtinApplication.ReportattachmentDataSource_add] No userTypes defined, allowing anyone access to all operations for this application
      === 2011-10-06 17:11:45,388 [0-26] DEBUG AppBase - [builtinApplication.ReportattachmentDataSource_add] No public zero-argument method named '_ReportattachmentDataSource_add' found, performing generic datasource operation
      === 2011-10-06 17:11:45,389 [0-26] WARN  Validation - [builtinApplication.ReportattachmentDataSource_add] No such type 'binary', not processing field value at /ReportattachmentDataSource/attachment_CONTENTS
      === 2011-10-06 17:11:45,390 [0-26] INFO  SQLDataSource - [builtinApplication.ReportattachmentDataSource_add] Performing add operation with
      	criteria: {}	values: {REPORT_ID:1.0,_transaction:null,attachment_CONTENTS_date_created:new Date(1317921105385),attachment_CONTENTS_filesize:286,attachment_CONTENTS_filename:"attributemap.xml"}
      === 2011-10-06 17:11:45,390 [0-26] INFO  SQLValuesClause - [builtinApplication.ReportattachmentDataSource_add] Ignored data for non-existent columns: [_transaction]
      === 2011-10-06 17:11:45,391 [0-26] DEBUG SQLValuesClause - [builtinApplication.ReportattachmentDataSource_add] Sequences: {}
      === 2011-10-06 17:11:45,437 [0-26] DEBUG PoolableSQLConnectionFactory - [builtinApplication.ReportattachmentDataSource_add] Returning pooled Connection
      === 2011-10-06 17:11:45,438 [0-26] DEBUG SQLTransaction - [builtinApplication.ReportattachmentDataSource_add] Started new Oracle transaction "235491707"
      === 2011-10-06 17:11:45,439 [0-26] INFO  SQLDriver - [builtinApplication.ReportattachmentDataSource_add] Executing SQL update on 'Oracle': INSERT INTO schema.REPORT_attachment (attachment_CONTENTS, attachment_CONTENTS_date_created, attachment_CONTENTS_filename, attachment_CONTENTS_filesize, REPORT_ID) VALUES (?, TO_DATE('2011-10-06 17:11:45','YYYY-MM-DD HH24:MI:SS'), 'attributemap.xml', 286, 1.0)
      === 2011-10-06 17:11:45,446 [0-26] WARN  RequestContext - dsRequest.execute() failed: 
      java.sql.SQLException: ORA-01400: cannot insert NULL into ("schema"."REPORT_attachment"."attachment_TIMESTAMP")
      
      	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
      	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
      	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
      	at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
      	at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
      	at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:955)
      	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
      	at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
      	at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3368)
      	at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
      	at com.isomorphic.sql.SQLDriver.doUpdate(SQLDriver.java:471)
      	at com.isomorphic.sql.SQLDriver.update(SQLDriver.java:425)
      	at com.isomorphic.sql.SQLDriver.executeUpdate(SQLDriver.java:545)
      	at com.isomorphic.sql.SQLDataSource.executeNativeUpdate(SQLDataSource.java:388)
      	at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:1341)
      	at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:280)
      	at com.isomorphic.sql.SQLDataSource.executeAdd(SQLDataSource.java:232)
      	at com.isomorphic.datasource.DataSource.execute(DataSource.java:1156)
      	at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:721)
      	at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658)
      	at com.isomorphic.application.AppBase.execute(AppBase.java:491)
      	at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1714)
      	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:199)
      	at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:156)
      	at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:121)
      	at com.isomorphic.servlet.IDACall.doPost(IDACall.java:73)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1097)
      	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:259)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1088)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
      	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      	at org.mortbay.jetty.Server.handle(Server.java:324)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
      	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
      	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
      === 2011-10-06 17:11:45,448 [0-26] DEBUG RPCManager - Content type for RPC transaction: text/html; charset=UTF-8
      === 2011-10-06 17:11:45,449 [0-26] DEBUG SQLTransaction - Rolling back Oracle transaction "235491707"
      === 2011-10-06 17:11:45,451 [0-26] DEBUG RPCManager - non-DMI response, dropExtraFields: false
      === 2011-10-06 17:11:45,452 [0-26] DEBUG SQLTransaction - Ending Oracle transaction "235491707"
      === 2011-10-06 17:11:45,456 [0-26] INFO  Compression - /productanalysisinterface/sc/IDACall: 643 -> 411 bytes

      Comment


        #4
        Where do we stand with this?

        Comment


          #5
          We can't reproduce this so far, and we're starting to wonder if you perhaps got a bad nightly. Can you re-check with the latest nightly?

          Also can you verify the stream is actually present server-side (available within a DMI from dsRequest.getUploadedFile()) - what can sometimes happen is that a servlet filter will strip off the file before the request reaches our code (Struts, for example, does this - but so do others).

          Comment


            #6
            Actually, on a second look at this, we think that all of your problem is being caused by that refusal to insert a null into the "attachment_TIMESTAMP" column, which is happening because the field type should be "modifierTimestamp" (note that it is case-sensitive and your rendering of it is all lowercase).

            The message about "No such type 'binary'" is just a warning from the validation subsystem telling you that "binary" is not a validatable type - we're going to change things so that message isn't sent any more, because it is misleading.

            Please try changing that field type and let us know if you're still having problems.

            Comment


              #7
              Originally posted by Isomorphic
              Actually, on a second look at this, we think that all of your problem is being caused by that refusal to insert a null into the "attachment_TIMESTAMP" column, which is happening because the field type should be "modifierTimestamp" (note that it is case-sensitive and your rendering of it is all lowercase).

              The message about "No such type 'binary'" is just a warning from the validation subsystem telling you that "binary" is not a validatable type - we're going to change things so that message isn't sent any more, because it is misleading.

              Please try changing that field type and let us know if you're still having problems.
              You may be correct. I removed the mod_timestamp column from the table and the insert works. I'm able to re-download the attachment. However, I do encounter a problem. The first file I was able to upload was called meta.log, and its just a test file. But now everytime I upload an attachment, the table shows that the file that has been attached is called meta.log. The attachment is being performed inside a nested grid, and the nested grid auto updates after the insert to show that the new file that has been uploaded is called "meta.log", in otherwords, in the attachment_contents column that shows the view and download buttons for the attachment, it always says meta.log. If I close the nested grid and reopen it, the correct filename shows. This is consistent across launches and compiles.

              Code:
              // create the list grid and set the datasource for the list grid
              		theListGrid = new ListGrid()
              		{
              			/**
              			 * this method gets the data source of the inner list grid
              			 * when a record is clicked
              			 */
              			public DataSource getRelatedDataSource(ListGridRecord record)
              			{
              				return DataSource.getDataSource(RELATED_DATA_SOURCE_NAME);
              			}
              			
              			/**
              			 * this method gets the canvas that the inner list grid is 
              			 * on when the record is expanded
              			 */
              			protected Canvas getExpansionComponent(final ListGridRecord 
              					record)
              			{
              				final ListGrid grid = this;
              				
              				// create the layout that the list grid and the buttons
              				// will be placed on and set the margin & padding to 5
              				VLayout layout = new VLayout(5);
              				layout.setPadding(5);
              				
              				// create the new grid that will display the attachments that
              				// correspond to the selected report
              				final ListGrid attachmentGrid = new ListGrid();
              				
              				// set the appropriate properties of the grid
              				attachmentGrid.setWidth("95%");
              				attachmentGrid.setHeight(300);
              				attachmentGrid.setCellHeight(22);
              				attachmentGrid.setDataSource(getRelatedDataSource(record));
              				attachmentGrid.fetchRelatedData(record, 
              						DataSource.getDataSource(DATA_SOURCE_NAME));
              				
              				// add the list grid to the layout
              				layout.addMember(attachmentGrid);
              				
              				// create the form that will be used to upload any attachment
              				// and set the data source for it
              				final DynamicForm uploadForm = new DynamicForm();
              				uploadForm.setDataSource(
              						DataSource.getDataSource(RELATED_DATA_SOURCE_NAME));
              				
              				// create the file item to allow the user to select the
              				// file to be uploaded
              				FileItem theFile = new FileItem(attachment_CONTENTS, 
              						ADD_attachment);
              				
              				// create the float item that will represent the report 
              				// id and make it invisible so the user cannot modify it
              				final FloatItem fileID = new FloatItem(file_ID, file_ID);
              				fileID.setValue(record.getAttributeAsFloat(file_ID));
              				fileID.setVisible(false);
              				
              				// the date time item that will represent the timestamp
              				// of when the attachment was created
              				DateTimeItem attachmentTimestamp = 
              					new DateTimeItem(attachment_TIMESTAMP, attachment_TIMESTAMP);
              				attachmentTimestamp.setVisible(false);				
              								
              				// create the button item to commit the file upload
              				ButtonItem upload = new ButtonItem(UPLOAD, UPLOAD);
              				
              				// add the clickhandler to the button item to perform
              				// the upload to the database
              				upload.addClickHandler(new 
              						com.smartgwt.client.widgets.form.fields.events.ClickHandler()
              				{
              					
              					/**
              					 * when the upload button is clicked the smartgwt framework 
              					 * will make and rpc and save the file to the PQD 
              					 */
              					@Override
              					public void onClick(
              							com.smartgwt.client.widgets.form.fields.events.ClickEvent event) 
              					{
              						fileID.setValue(record.getAttributeAsFloat(file_ID));
              						uploadForm.saveData(
              								new com.smartgwt.client.data.DSCallback() 
              						{
              
              							@Override
              							public void execute(DSResponse response,
              									Object rawData, DSRequest request) 
              							{
              								uploadForm.editNewRecord();
              							}
              							
              						});
              					}
              					
              				});
              				
              				// add the fields to the dynamic form
              				uploadForm.setFields(fileID, theFile, upload,
              						modTimestamp, attachmentTimestamp);
              				
              				// add the form to the layout
              				layout.addMember(uploadForm);
              				
              				// return the newly create layout that holds the inner 
              				// list grid
              				return layout;
              			}
              		};
              		setListGridProperties(DATA_SOURCE_NAME);
              		
              		// create the dates for the last 24 hours in order to filter
              		// the data in the list grid
              		theStartDate = new Date();
              		theEndDate = new Date();
              		CalendarUtil.addDaysToDate(theStartDate, -1);
              		
              		// create the initial criteria to filter the data displayed
              		// in the list grid to just the last 24 hours worth
              		// of data
              		Criterion initialCriteria = 
              			new Criterion(CREATED_TIMESTAMP,
              					OperatorId.BETWEEN_INCLUSIVE,
              					theStartDate, theEndDate);
              		
              		// add the list grid to the vlayout
              		theListGrid.setInitialCriteria(initialCriteria);
              		
              		// set the draw ahead ratio for the list grid to 4 and make the
              		// list Grid expandable
              		theListGrid.setDrawAheadRatio(4);
              		theListGrid.setCanExpandRecords(true);
              		theListGrid.setCanExpandMultipleRecords(false);		
              		
              		// add the listgrid to the vlayout
              		this.addMember(theListGrid);
              Code:
              <DataSource ID="FileAttachmentDataSource" dataFormat="iscServer" serverType="sql" dataSourceVersion="1" 
              dbName="Oracle" schema="xx_yy" tableName="File_Attachment">
                  <fields>
                      <field name="file_ID" type="float" foreignKey="true" primaryKey="true">
                      </field>
                      <field name="attachment_contents_date_created" type="datetime" primaryKey="true"/>
                      <field name="attachment_contents" type="binary"/>
                  </fields>
                  <generatedBy>SC_SNAPSHOT-2011-09-15/PowerEdition Deployment 2011-09-15</generatedBy>
              </DataSource>
              It is also not displaying the date_created field correctly in the list grid. the correct date appears but the incorrect time appears. It shows the time 12:00:00 for all entries, something like 10/10/2011 12:00:00 and 10/11/2011 12:00:00. This datetime issue is presenting problems when I try to download the attachment, since it queries for the file_ID and the date_created but the date created doesn't match so I'm not able to download anything. How can I fix this?

              Comment


                #8
                For the recurring "meta.log" issue, take a look at server-side logs for the request. If you see "meta.log" coming from the browser, you've got some kind of client-side issue. Otherwise, it suggest some kind of server custom logic is fetching the old name from the DB before doing the save. If you need more help on this one, post the logs and any custom server code so we can take a look.

                We'll look into the timestamp issue.

                Comment


                  #9
                  Originally posted by Isomorphic
                  For the recurring "meta.log" issue, take a look at server-side logs for the request. If you see "meta.log" coming from the browser, you've got some kind of client-side issue. Otherwise, it suggest some kind of server custom logic is fetching the old name from the DB before doing the save. If you need more help on this one, post the logs and any custom server code so we can take a look.

                  We'll look into the timestamp issue.
                  Here is the log. I no longer see the name meta.log, now I am seeing AReport.pdf, which is a pdf I have uploaded already. I got it to change by closing eclipse and restarting, but now it always says AReport.pdf. I didn't find any mention of it in the server logs. There is also no server custom logic. You have my datasource above, and my java class also. I followed the example online for file upload. I am noticing that it duplicates the date and name of the first record. Last time meta.log was the first record, and it was being duplicated. Now it is AReport.pdf that is first and now it is getting duplicated. If I close and open the table, it fixes itself. What could be going on?
                  Code:
                  === 2011-10-11 17:01:52,478 [0-19] INFO  RequestContext - URL: '/myproject/sc/IDACall', User-Agent: 'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.20) Gecko/20110803 Firefox/3.6.20': Moz (Gecko) with Accept-Encoding header
                  === 2011-10-11 17:01:52,574 [0-19] DEBUG XML - Parsed XML from (in memory stream): 94ms
                  === 2011-10-11 17:01:52,615 [0-19] DEBUG RPCManager - Processing 1 requests.
                  === 2011-10-11 17:01:52,617 [0-19] DEBUG RPCManager - Request #1 (DSRequest) payload: {
                      criteria:{
                          file_ID:1
                      },
                      operationConfig:{
                          dataSource:"FileAttachmentDataSource",
                          operationType:"fetch",
                          textMatchStyle:"exact"
                      },
                      startRow:0,
                      endRow:75,
                      componentId:"isc_ListGrid_1",
                      appID:"builtinApplication",
                      operation:"FileAttachmentDataSource_fetch",
                      oldValues:{
                          file_ID:1
                      }
                  }
                  === 2011-10-11 17:01:52,617 [0-19] INFO  IDACall - Performing 1 operation(s)
                  === 2011-10-11 17:01:52,618 [0-19] DEBUG AppBase - [builtinApplication.FileAttachmentDataSource_fetch] No userTypes defined, allowing anyone access to all operations for this application
                  === 2011-10-11 17:01:52,618 [0-19] DEBUG AppBase - [builtinApplication.FileAttachmentDataSource_fetch] No public zero-argument method named '_FileAttachmentDataSource_fetch' found, performing generic datasource operation
                  === 2011-10-11 17:01:52,618 [0-19] INFO  SQLDataSource - [builtinApplication.FileAttachmentDataSource_fetch] Performing fetch operation with
                  	criteria: {file_ID:1}	values: {file_ID:1}
                  === 2011-10-11 17:01:52,619 [0-19] INFO  SQLDataSource - [builtinApplication.FileAttachmentDataSource_fetch] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
                  === 2011-10-11 17:01:52,620 [0-19] DEBUG SQLDataSource - [builtinApplication.FileAttachmentDataSource_fetch] Executing row count query: SELECT COUNT(*) FROM $defaultTableClause WHERE $defaultWhereClause
                  === 2011-10-11 17:01:52,621 [0-19] DEBUG SQLDataSource - [builtinApplication.FileAttachmentDataSource_fetch] Eval'd row count query: SELECT COUNT(*) FROM PP_PQ.File_Attachment WHERE (File_Attachment.file_ID='1')
                  === 2011-10-11 17:01:52,672 [0-19] DEBUG PoolableSQLConnectionFactory - [builtinApplication.FileAttachmentDataSource_fetch] Returning pooled Connection
                  === 2011-10-11 17:01:52,673 [0-19] DEBUG SQLTransaction - [builtinApplication.FileAttachmentDataSource_fetch] Started new Oracle transaction "401950686"
                  === 2011-10-11 17:01:52,674 [0-19] INFO  SQLDriver - [builtinApplication.FileAttachmentDataSource_fetch] Executing SQL query on 'Oracle': SELECT COUNT(*) FROM PP_PQ.File_Attachment WHERE (File_Attachment.file_ID='1')
                  === 2011-10-11 17:01:52,680 [0-19] WARN  SQLDataSource - [builtinApplication.FileAttachmentDataSource_fetch] DataSource 'FileAttachmentDataSource': sqlPaging was explicitly specified as 'sqlLimit', but the underlying database (oracle) does not support SQL limit queries.  Falling back to 'jdbcScroll'
                  === 2011-10-11 17:01:52,681 [0-19] DEBUG SQLDataSource - [builtinApplication.FileAttachmentDataSource_fetch] JDBC driver windowed select rows 0->75, result size 75. Query: SELECT File_Attachment.attachment_contents_date_created, File_Attachment.attachment_contents_filename, File_Attachment.attachment_contents_filesize, File_Attachment.file_ID, File_Attachment.attachment_contents FROM PP_PQ.File_Attachment WHERE (File_Attachment.file_ID='1')
                  === 2011-10-11 17:01:52,698 [0-19] INFO  DSResponse - [builtinApplication.FileAttachmentDataSource_fetch] DSResponse: List with 15 items
                  === 2011-10-11 17:01:52,698 [0-19] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
                  === 2011-10-11 17:01:52,698 [0-19] DEBUG SQLTransaction - Committing Oracle transaction "401950686"
                  === 2011-10-11 17:01:52,700 [0-19] DEBUG RPCManager - non-DMI response, dropExtraFields: false
                  === 2011-10-11 17:01:52,707 [0-19] DEBUG SQLTransaction - Ending Oracle transaction "401950686"
                  === 2011-10-11 17:01:52,717 [0-19] INFO  Compression - /myproject/sc/IDACall: 2560 -> 434 bytes
                  === 2011-10-11 17:02:27,133 [0-21] INFO  Download - Returning 304: Not modified on conditional get of: /myproject/myproject/war/myproject/sc/skins/Enterprise/images/Scrollbar/hscroll_track.png
                  === 2011-10-11 17:02:27,134 [0-19] INFO  Download - Returning 304: Not modified on conditional get of: /myproject/myproject/war/myproject/sc/skins/Enterprise/images/Scrollbar/hscroll_start.png
                  === 2011-10-11 17:02:27,135 [0-23] INFO  Download - Returning 304: Not modified on conditional get of: /myproject/myproject/war/myproject/sc/skins/Enterprise/images/Scrollbar/hscroll_end.png
                  === 2011-10-11 17:02:27,161 [0-23] INFO  Download - Returning 304: Not modified on conditional get of: /myproject/myproject/war/myproject/sc/skins/Enterprise/images/Scrollbar/hthumb_grip.png
                  === 2011-10-11 17:02:27,173 [0-23] INFO  Download - Returning 304: Not modified on conditional get of: /myproject/myproject/war/myproject/sc/skins/Enterprise/images/Scrollbar/hthumb_start.png
                  === 2011-10-11 17:02:27,177 [0-19] INFO  Download - Returning 304: Not modified on conditional get of: /myproject/myproject/war/myproject/sc/skins/Enterprise/images/Scrollbar/hthumb_stretch.png
                  === 2011-10-11 17:02:27,181 [0-23] INFO  Download - Returning 304: Not modified on conditional get of: /myproject/myproject/war/myproject/sc/skins/Enterprise/images/Scrollbar/hthumb_end.png
                  === 2011-10-11 17:02:27,933 [0-23] INFO  Download - Returning 304: Not modified on conditional get of: /myproject/myproject/war/myproject/sc/skins/Enterprise/images/Scrollbar/vscroll_corner.png
                  === 2011-10-11 17:02:39,547 [0-19] INFO  Download - Returning 304: Not modified on conditional get of: /myproject/myproject/war/myproject/sc/skins/Enterprise/images/button/button_Down_stretch.png
                  === 2011-10-11 17:02:39,547 [0-23] INFO  Download - Returning 304: Not modified on conditional get of: /myproject/myproject/war/myproject/sc/skins/Enterprise/images/button/button_Down_start.png
                  === 2011-10-11 17:02:39,548 [0-21] INFO  Download - Returning 304: Not modified on conditional get of: /myproject/myproject/war/myproject/sc/skins/Enterprise/images/button/button_Down_end.png
                  === 2011-10-11 17:02:39,729 [0-21] INFO  RequestContext - URL: '/myproject/sc/IDACall', User-Agent: 'Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.20) Gecko/20110803 Firefox/3.6.20': Moz (Gecko) with Accept-Encoding header
                  === 2011-10-11 17:02:39,790 [0-21] DEBUG XML - Parsed XML from (in memory stream): 36ms
                  === 2011-10-11 17:02:39,797 [0-21] DEBUG RPCManager - Processing 1 requests.
                  === 2011-10-11 17:02:39,802 [0-21] DEBUG RPCManager - Request #1 (DSRequest) payload: {
                      values:{
                          attachment_contents:"new_report.pdf",
                          file_ID:1,
                          attachment_contents_date_created:new Date(1318352559799),
                          attachment_contents_filename:"new_report.pdf",
                          attachment_contents_filesize:134601
                      },
                      operationConfig:{
                          dataSource:"FileAttachmentDataSource",
                          operationType:"add"
                      },
                      componentId:"isc_DynamicForm_5",
                      appID:"builtinApplication",
                      operation:"FileAttachmentDataSource_add",
                      oldValues:{
                      },
                      criteria:{
                      }
                  }
                  === 2011-10-11 17:02:39,802 [0-21] INFO  IDACall - Performing 1 operation(s)
                  === 2011-10-11 17:02:39,803 [0-21] DEBUG AppBase - [builtinApplication.FileAttachmentDataSource_add] No userTypes defined, allowing anyone access to all operations for this application
                  === 2011-10-11 17:02:39,803 [0-21] DEBUG AppBase - [builtinApplication.FileAttachmentDataSource_add] No public zero-argument method named '_FileAttachmentDataSource_add' found, performing generic datasource operation
                  === 2011-10-11 17:02:39,805 [0-21] WARN  Validation - [builtinApplication.FileAttachmentDataSource_add] No such type 'binary', not processing field value at /FileAttachmentDataSource/attachment_contents
                  === 2011-10-11 17:02:39,805 [0-21] INFO  SQLDataSource - [builtinApplication.FileAttachmentDataSource_add] Performing add operation with
                  	criteria: {}	values: {file_ID:1,attachment_contents_date_created:new Date(1318352559799),attachment_contents_filename:"new_report.pdf",attachment_contents_filesize:134601}
                  === 2011-10-11 17:02:39,806 [0-21] DEBUG SQLValuesClause - [builtinApplication.FileAttachmentDataSource_add] Sequences: {}
                  === 2011-10-11 17:02:39,838 [0-21] DEBUG PoolableSQLConnectionFactory - [builtinApplication.FileAttachmentDataSource_add] Returning pooled Connection
                  === 2011-10-11 17:02:39,839 [0-21] DEBUG SQLTransaction - [builtinApplication.FileAttachmentDataSource_add] Started new Oracle transaction "1396924472"
                  === 2011-10-11 17:02:39,839 [0-21] INFO  SQLDriver - [builtinApplication.FileAttachmentDataSource_add] Executing SQL update on 'Oracle': INSERT INTO PP_PQ.File_Attachment (file_ID, attachment_contents, attachment_contents_date_created, attachment_contents_filename, attachment_contents_filesize) VALUES (1, ?, TO_DATE('2011-10-11 17:02:39','YYYY-MM-DD HH24:MI:SS'), 'new_report.pdf', 134601)
                  === 2011-10-11 17:02:39,865 [0-21] DEBUG SQLDataSource - [builtinApplication.FileAttachmentDataSource_add] add operation affected 1 rows
                  === 2011-10-11 17:02:39,866 [0-21] INFO  SQLDataSource - [builtinApplication.FileAttachmentDataSource_add] primaryKeys: {file_ID=1}
                  === 2011-10-11 17:02:39,866 [0-21] INFO  SQLDriver - [builtinApplication.FileAttachmentDataSource_add] Executing SQL query on 'Oracle': SELECT File_Attachment.attachment_contents_date_created, File_Attachment.attachment_contents_filename, File_Attachment.attachment_contents_filesize, File_Attachment.file_ID, File_Attachment.attachment_contents FROM PP_PQ.File_Attachment WHERE (File_Attachment.file_ID='1')
                  === 2011-10-11 17:02:39,884 [0-21] INFO  DSResponse - [builtinApplication.FileAttachmentDataSource_add] DSResponse: List with 1 items
                  === 2011-10-11 17:02:39,885 [0-21] DEBUG RPCManager - Content type for RPC transaction: text/html; charset=UTF-8
                  === 2011-10-11 17:02:39,885 [0-21] DEBUG SQLTransaction - Committing Oracle transaction "1396924472"
                  === 2011-10-11 17:02:39,891 [0-21] DEBUG RPCManager - non-DMI response, dropExtraFields: false
                  === 2011-10-11 17:02:39,896 [0-21] DEBUG SQLTransaction - Ending Oracle transaction "1396924472"
                  === 2011-10-11 17:02:39,901 [0-21] INFO  Compression - /myproject/sc/IDACall: 708 -> 434 bytes
                  === 2011-10-11 17:02:41,431 [0-21] INFO  Download - Returning 304: Not modified on conditional get of: /myproject/myproject/war/myproject/sc/skins/Enterprise/images/Scrollbar/hthumb_Over_start.png
                  === 2011-10-11 17:02:41,433 [0-23] INFO  Download - Returning 304: Not modified on conditional get of: /myproject/myproject/war/myproject/sc/skins/Enterprise/images/Scrollbar/hthumb_Over_stretch.png
                  === 2011-10-11 17:02:41,441 [0-23] INFO  Download - Returning 304: Not modified on conditional get of: /myproject/myproject/war/myproject/sc/skins/Enterprise/images/Scrollbar/hthumb_Over_end.png
                  === 2011-10-11 17:02:48,831 [0-23] INFO  Download - Returning 304: Not modified on conditional get of: /myproject/myproject/war/myproject/sc/skins/Enterprise/images/Scrollbar/hthumb_Over_end.png
                  Here is the data source for the outer table
                  Code:
                  <DataSource ID="fileDataSource" dataFormat="iscServer" serverType="sql" 
                  dataSourceVersion="1" dbName="Oracle" schema="xx_yy" tableName="file">
                  
                  <!-- List all the fields that will be displayed in the file
                  listgrid -->
                      <fields>
                          <field name="file_name" type="text" length="50"/>
                          <field name="CREATED_TIMESTAMP" type="datetime"/>
                          <field name="file_ID" type="int" primaryKey="true"/>
                          <field name="file_TYPE_NAME" type="text" length="30">
                          	<tableName>file_TYPE</tableName>
                          </field>
                      </fields>
                      
                      <!-- add the proper where clause to be used to join the repor & the
                      file_type tables including the default where clause that is 
                      generated by the operator when values are entered in to the list grids
                      filter editor -->
                      <operationBindings>
                      	<OperationBinding>
                      		<operationType>fetch</operationType>
                      		<tableClause>file, file_TYPE
                      		</tableClause>
                      		<whereClause>
                      			file.file_TYPE_ID = file_TYPE.file_TYPE_ID AND
                      			($defaultWhereClause)
                      		</whereClause>
                      	</OperationBinding>
                      </operationBindings>
                      <generatedBy>SC_SNAPSHOT-2011-09-15/PowerEdition Deployment 2011-09-15</generatedBy>
                  </DataSource>

                  Comment


                    #10
                    We fixed the problem with the timestamps, it will be in the next nightly.

                    About the stale filenames, the question was, when a stale filename is used, are you seeing that that stale filename was *submitted by the browser*? If so, it would be a client-side problem, and your result that it could be fixed by shutting down Eclipse suggests that it may be a GWT hosted mode issue.

                    So let us know if the staleness seems to be coming from the browser, and if so, try compiled mode and try another browser (and let us know which browser had the problem).

                    Comment


                      #11
                      Originally posted by Isomorphic
                      We fixed the problem with the timestamps, it will be in the next nightly.

                      About the stale filenames, the question was, when a stale filename is used, are you seeing that that stale filename was *submitted by the browser*? If so, it would be a client-side problem, and your result that it could be fixed by shutting down Eclipse suggests that it may be a GWT hosted mode issue.

                      So let us know if the staleness seems to be coming from the browser, and if so, try compiled mode and try another browser (and let us know which browser had the problem).
                      So for the timestamp issue, will the datetime data type source work? I have
                      Code:
                      <field name="attachment_contents_date_created" type="datetime" primaryKey="true"/>
                      As for the stale filename, I don't see the name to be submitted by the browser. No where in the developer console logs or any other logs do I see the stale filename. Is there anywhere else I can check for this? I am running on red hat linux and only have firefox 3.6.20 available to me so I cannot try another browser.

                      Comment


                        #12
                        Yes, the datetime DataSource will work.

                        If that's your only browser, you can at least try compiled mode.

                        As far as the logs, what you're saying is, you uploaded a file with name "stale.log" then when see the server logs for uploading "new.log", the only filename that appears in the logs is "new.log" yet in the actual database (check the database directly, not via the UI) you see the contents of new.log have been saved but given the filename "stale.log"?

                        If this is not the case, please explain precisely what you're seeing, in similar detail.

                        Comment


                          #13
                          Originally posted by Isomorphic
                          Yes, the datetime DataSource will work.

                          If that's your only browser, you can at least try compiled mode.

                          As far as the logs, what you're saying is, you uploaded a file with name "stale.log" then when see the server logs for uploading "new.log", the only filename that appears in the logs is "new.log" yet in the actual database (check the database directly, not via the UI) you see the contents of new.log have been saved but given the filename "stale.log"?

                          If this is not the case, please explain precisely what you're seeing, in similar detail.
                          I apologize for not being clear. So, I am displaying 3 columns, the file id, the date created and the attachment contents. I am not displaying the file name. What happens when I add an attachment, is the following, the attachment uploads successfully with the correct name and all, and the incorrect contents and date created are displayed in the new row in the listgrid. What I mean when I say incorrect contents is that when you display the content field, it shows you the filename and the magnifying glass icon and the download file icon. For example, if I upload a file name foo.pdf now, the file will upload successfully and will be present in the database with the correct name, correct date created, correct size, but will display an incorrect date created and content in the listgrid. It will display the date created and content of a previous uploaded file named previousfoo.pdf where date created was yesterday. If you query the database via sqldeveloper, the correct information will show up and I can see the file was uploaded successfully. However, if I close the listgrid, since it is a nested listgrid, and open it again, it will display the correct data, foo.pdf created today, not previousfoo.pdf created yesterday. The issue is not the actual upload, the issue is after the upload when the table auto updates itself, it doesn't auto update correctly. Is this clear?

                          Comment


                            #14
                            Yes, and much less mysterious. What is likely happening is incorrect primary keys being sent back from your server logic. Take a look at the troubleshooting steps for "Grids not updating.." in the FAQ - this may solve it for you, if not, please post the logs and other information indicated in that FAQ item.

                            Comment

                            Working...
                            X