Announcement

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

    viewFile and downloadFile running forever...

    Hi, I am using SmartClient 11.0p 17-03-29 with MSSQL 2012.
    I have successfully uploaded files to SQL server usning multiFileItem as instructed in the example.
    However when I click the view icon or download icon from the multFile control. It never responde and server hangs.
    When I looked at the RPC response in the console it say [Request in Progress].
    I have also tried jtds driver as someone said he solved with the driver but no luck for me.
    Please anybody help me on this.

    This is the table I created.
    CREATE TABLE [dbo].[c004_ssc_activity_files](
    [id] [int] IDENTITY(1,1) NOT NULL,
    [contents_filename] [nvarchar](255) NULL,
    [contents_filesize] [numeric](10, 0) NULL,
    [contents_date_created] [datetime] NULL,
    [activity_id] [int] NULL,
    [contents] [varbinary](max) NULL,
    CONSTRAINT [PK_c004_ssc_activity_files] PRIMARY KEY CLUSTERED
    (
    [id] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]


    And this is the datasource,
    <DataSource
    schema="dbo"
    serverType="sql"
    dbName="SmartOffice"
    ID="c004_ssc_activity_files"
    tableName="c004_ssc_activity_files"
    >
    <fields>
    <field name="id" type="sequence" hidden="true" primaryKey="true" implicitSequence="true"></field>
    <field name="activity_id" type="integer" foreignKey="c000_ssc_activities.id" hidden="true"></field>
    <field name="contents" type="binary"></field>

    </fields>

    </DataSource>

    The server log is like this,
    === 2017-05-25 18:37:32,460 [ec-2] DEBUG SQLDataSource - DataSource 560 acquired SQLDriver instance 1900438937 during initialization
    === 2017-05-25 18:37:32,460 [ec-2] DEBUG RPCManager - Request #1 (DSRequest) payload: {
    criteria:{
    id:24,
    download_fieldname:"contents",
    download_filename:"aaa.XLS"
    },
    operationConfig:{
    dataSource:"c004_ssc_activity_files",
    repo:null,
    operationType:"viewFile",
    textMatchStyle:"exact"
    },
    appID:"builtinApplication",
    operation:"c004_ssc_activity_files_viewFile",
    oldValues:{
    id:24,
    download_fieldname:"contents",
    download_filename:"aaa.XLS"
    }
    }
    === 2017-05-25 18:37:32,476 [ec-2] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
    === 2017-05-25 18:37:32,476 [ec-2] DEBUG DeclarativeSecurity - DataSource c004_ssc_activity_files is not in the pre-checked list, processing...
    === 2017-05-25 18:37:32,507 [ec-2] DEBUG AppBase - [builtinApplication.c004_ssc_activity_files_viewFile] No userTypes defined, allowing anyone access to all operations for this application
    === 2017-05-25 18:37:32,507 [ec-2] DEBUG AppBase - [builtinApplication.c004_ssc_activity_files_viewFile] No public zero-argument method named '_c004_ssc_activity_files_viewFile' found, performing generic datasource operation
    === 2017-05-25 18:37:32,523 [ec-2] DEBUG DeclarativeSecurity - [builtinApplication.c004_ssc_activity_files_viewFile] Processing security checks for DataSource null, field null
    === 2017-05-25 18:37:32,523 [ec-2] DEBUG DeclarativeSecurity - [builtinApplication.c004_ssc_activity_files_viewFile] Request is not a client request, ignoring security checks.
    === 2017-05-25 18:37:32,523 [ec-2] DEBUG AppBase - [builtinApplication.c004_ssc_activity_files_viewFile, builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
    === 2017-05-25 18:37:32,523 [ec-2] DEBUG AppBase - [builtinApplication.c004_ssc_activity_files_viewFile, builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
    === 2017-05-25 18:37:32,523 [ec-2] INFO SQLDataSource - [builtinApplication.c004_ssc_activity_files_viewFile, builtinApplication.null] Performing fetch operation with
    criteria: {id:24,download_fieldname:"contents",download_filename:"aaa.XLS"} values: {id:24,download_fieldname:"contents",download_filename:"aaa.XLS"}
    === 2017-05-25 18:37:32,570 [ec-2] INFO SQLDataSource - [builtinApplication.c004_ssc_activity_files_viewFile, builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
    === 2017-05-25 18:37:32,570 [ec-2] INFO Velocity - [builtinApplication.c004_ssc_activity_files_viewFile, builtinApplication.null] Velocity Tools not available - using standard Velocity Contexts.
    === 2017-05-25 18:37:32,586 [ec-2] DEBUG Velocity - [builtinApplication.c004_ssc_activity_files_viewFile, builtinApplication.null] Velocity config: {
    }
    === 2017-05-25 18:37:32,851 [ec-2] INFO SQLDataSource - [builtinApplication.c004_ssc_activity_files_viewFile, builtinApplication.null] 560: Executing SQL query on 'SmartOffice': SELECT c004_ssc_activity_files.id, c004_ssc_activity_files.activity_id, c004_ssc_activity_files.contents, c004_ssc_activity_files.contents_filename, c004_ssc_activity_files.contents_filesize, c004_ssc_activity_files.contents_date_created FROM dbo.c004_ssc_activity_files WHERE (c004_ssc_activity_files.id=24)
    === 2017-05-25 18:37:32,976 [ec-2] INFO PoolManager - [builtinApplication.c004_ssc_activity_files_viewFile, builtinApplication.null] SmartClient pooling disabled for 'SmartOffice' objects
    === 2017-05-25 18:37:32,976 [ec-2] DEBUG PoolableSQLConnectionFactory - [builtinApplication.c004_ssc_activity_files_viewFile, builtinApplication.null] Initializing SQL config for 'SmartOffice' from system config - using DriverManager: com.microsoft.sqlserver.jdbc.SQLServerDriver
    === 2017-05-25 18:37:33,023 [ec-2] DEBUG PoolableSQLConnectionFactory - [builtinApplication.c004_ssc_activity_files_viewFile, builtinApplication.null] com.microsoft.sqlserver.jdbc.SQLServerDriver lookup successful
    === 2017-05-25 18:37:33,023 [ec-2] DEBUG PoolableSQLConnectionFactory - [builtinApplication.c004_ssc_activity_files_viewFile, builtinApplication.null] DriverManager fetching connection for SmartOffice via jdbc url jdbc:sqlserver://127.0.0.1:1433;DatabaseName=SmartOffice;User=SmartOffice;Password=SmartOffice
    === 2017-05-25 18:37:33,023 [ec-2] DEBUG PoolableSQLConnectionFactory - [builtinApplication.c004_ssc_activity_files_viewFile, builtinApplication.null] Passing JDBC URL only to getConnection
    === 2017-05-25 18:37:33,195 [ec-2] DEBUG PoolableSQLConnectionFactory - [builtinApplication.c004_ssc_activity_files_viewFile, builtinApplication.null] makeObject() created an unpooled Connection '1448452451'
    === 2017-05-25 18:37:33,195 [ec-2] DEBUG SQLConnectionManager - [builtinApplication.c004_ssc_activity_files_viewFile, builtinApplication.null] Borrowed connection '1448452451'
    === 2017-05-25 18:37:33,195 [ec-2] INFO SQLDriver - [builtinApplication.c004_ssc_activity_files_viewFile, builtinApplication.null] Executing SQL query on 'SmartOffice' using connection '1448452451': SELECT c004_ssc_activity_files.id, c004_ssc_activity_files.activity_id, c004_ssc_activity_files.contents, c004_ssc_activity_files.contents_filename, c004_ssc_activity_files.contents_filesize, c004_ssc_activity_files.contents_date_created FROM dbo.c004_ssc_activity_files WHERE (c004_ssc_activity_files.id=24)
    === 2017-05-25 18:37:33,382 [ec-2] DEBUG SQLTransaction - getConnection() looked for transactional connection for SmartOffice: (connection is null)
    === 2017-05-25 18:37:33,398 [ec-2] DEBUG SQLDataSource - About to clear SQLDriver state for DS instance 560
    === 2017-05-25 18:37:33,398 [ec-2] DEBUG SQLDriver - Freeing SQLDriver dbConnection 1448452451 for SQLDriver instance 1900438937
    === 2017-05-25 18:37:33,398 [ec-2] DEBUG SQLConnectionManager - About to close SQLServerConnection with hashcode "1448452451"
    === 2017-05-25 18:37:33,398 [ec-2] DEBUG SQLDataSource - About to clear SQLDriver state for DS instance 560
    === 2017-05-25 18:37:33,398 [ec-2] DEBUG SQLDataSource - About to clear SQLDriver state for DS instance 560
    === 2017-05-25 18:37:33,398 [ec-2] DEBUG SQLTransaction - getConnection() looked for transactional connection for SmartOffice: (connection is null)
    === 2017-05-25 18:37:33,414 [ec-2] DEBUG SQLDataSource - About to clear SQLDriver state for DS instance 560


    #2
    First check your client-side Developer Console and report what's there - you should always do this.

    Check with multiple browsers and report whether this a browser-specific problem, and disable extensions in any browsers where there's an issue (this also you should always do).

    You can also check that the file is present and intact via direct SQL access. Also check with the browser built-in developer tools to see whether any data was transferred, and whether HTTP headers such as Content-Type and Content-Length seem to be set correctly.

    Comment


      #3
      I have found that the file "contents" is not saved in the database whereas other fields(contents_filename, etc) are stored correctly.
      Is there any common mistake which causes contents are not saved?

      Comment


        #4
        We just explained all the things you should examine and post when you have an issue, so same thing, but now examine why your upload is failing.

        Comment

        Working...
        X