Announcement

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

    sqlStorageStrategy & RESTHandler

    RESTHandler is not obeying boolean criteria with the fetch operation when using MYSQL and TINYINT as the column type.

    I did find a thread instructing to set sqlStorageStrategy="integer" (http://forums.smartclient.com/showthread.php?t=20933&highlight=mysql+boolean).

    When I tried this I discovered that this method works when using SmartGWT's wireformat (via IDACALL) but does not work when RESTHandler is used.

    My question is, is this a supported setting for RESTHandler?

    Thanks!

    #2
    The REST message you should send is unaffected by sqlStorageStrategy - send boolean values regardless.

    If you think there's a bug, please provide a minimal, ready-to-run testcase and version and environment information as listed by the forums.

    Comment


      #3
      I believe its a bug with RestHandler, here's the standalone test case.

      - Our architecture requires me to use RestHandler instead of IDACall, I'm using ListGrid and RestDataSource on client side to connect to RestHandler on SmartGwt server (SmartGwt Power 3.0p).
      - When checking on "verified" field in FilterEditor, then click "Refresh" button, the request is sent to server with "verified"=true.
      - (If I modify the client side code to make requests though IDACall, the filter works correctly.)

      - In the server log i see this:
      === 2012-02-29 18:53:01,446 [l0-2] INFO SQLDataSource - [builtinApplication.test_fetch] Performing fetch operation with
      criteria: {verified:"true"} values: {verified:"true"}
      === 2012-02-29 18:53:01,459 [l0-2] DEBUG SQLDataSource - [builtinApplication.test_fetch] SQL windowed select rows 0->75, result size 75. Query: SELECT test.id, test.verified, test.name FROM test WHERE (test.verified=0) LIMIT 0, 75

      Thanks in advance!

      == TEST.DS.XML ===================
      Code:
      <DataSource dbName="test" tableName="test" ID="test" serverType="sql">
      	<fields>
      		<field name="id" type="integer" />
      		<field name="name" type="text" />
      		<field name="verified" type="boolean" sqlStorageStrategy="integer"></field>
      	</fields>
      </DataSource>
      == SERVER.PROPERTIES (partial) ===================
      Code:
      sql.test.interface.type: dataSource
      sql.test.pool.enabled: true
      sql.test.driver.driverType: thin
      sql.test.driver.serverName: localhost
      sql.test.driver.useUnicode: true
      sql.test.driver.portNumber: 3306
      sql.test.driver.user: test
      sql.test.driver.networkProtocol: tcp
      sql.test.driver.password: test
      sql.test.driver.databaseName: test
      sql.test.database.type: mysql
      sql.test.database.ansiMode: false
      sql.test.driver: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
      sql.test.interface.credentialsInURL: true
      == DevModeEntryPoint.java ===================
      Code:
      package com.smartgwt.sample.client;
      
      import com.google.gwt.core.client.EntryPoint;
      import com.google.gwt.core.client.GWT;
      import com.smartgwt.client.data.Criteria;
      import com.smartgwt.client.data.DataSource;
      import com.smartgwt.client.data.RestDataSource;
      import com.smartgwt.client.data.fields.DataSourceBooleanField;
      import com.smartgwt.client.data.fields.DataSourceIntegerField;
      import com.smartgwt.client.data.fields.DataSourceTextField;
      import com.smartgwt.client.types.Alignment;
      import com.smartgwt.client.types.DSDataFormat;
      import com.smartgwt.client.widgets.Canvas;
      import com.smartgwt.client.widgets.IButton;
      import com.smartgwt.client.widgets.events.ClickEvent;
      import com.smartgwt.client.widgets.events.ClickHandler;
      import com.smartgwt.client.widgets.grid.ListGrid;
      import com.smartgwt.client.widgets.layout.HLayout;
      import com.smartgwt.client.widgets.layout.VLayout;
      
      public class DevModeEntryPoint implements EntryPoint {
      
      	public static class TestDatasource extends RestDataSource {
      
      		public TestDatasource() {
      			setDataURL(GWT.getModuleBaseURL() + "restapi/");
      			setDataFormat(DSDataFormat.JSON);
      			setID("test");
      			DataSourceIntegerField fId = new DataSourceIntegerField("id");
      			fId.setPrimaryKey(true);
      			DataSourceBooleanField fVerified = new DataSourceBooleanField("verified");
      			DataSourceTextField fName = new DataSourceTextField("name");
      			setFields(fId, fName, fVerified);
      		}
      	}
      
      	public Canvas getTestPanel(DataSource ds) {
      		final ListGrid grid = new ListGrid();
      		grid.setDataSource(ds);
      		grid.setUseAllDataSourceFields(true);
      		grid.setShowFilterEditor(true);
      
      		IButton refresh = new IButton("Refresh");
      		refresh.addClickHandler(new ClickHandler() {
      			@Override
      			public void onClick(ClickEvent event) {
      				grid.invalidateCache();
      				grid.fetchData(grid.getFilterEditorCriteria());
      			}
      		});
      
      		VLayout vl = new VLayout();
      		vl.setPadding(5);
      		vl.setMembersMargin(5);
      		vl.addMember(grid);
      		vl.addMember(refresh);
      		HLayout hl = new HLayout();
      		hl.setMembersMargin(5);
      
      		hl.setAlign(Alignment.CENTER);
      		vl.addMember(hl);
      		grid.fetchData();
      		return vl;
      	}
      
      	@Override
      	public void onModuleLoad() {
      		VLayout master = new VLayout();
      		master.setWidth100();
      		master.setHeight100();
      		master.addMember(getTestPanel(new TestDatasource()));
      		master.draw();
      	}
      }
      == WEB.XML (partial) ===================
      Code:
      	<servlet>
      		<servlet-name>RESTHandler</servlet-name>
      		<servlet-class>com.isomorphic.servlet.RESTHandler</servlet-class>
      		<init-param>
      			<param-name>defaultDataFormat</param-name>
      			<param-value>json</param-value>
      		</init-param>
      		<init-param>
      			<param-name>dynamicDataFormatParamName</param-name>
      			<param-value>theDataFormat</param-value>
      		</init-param>
      		<init-param>
      			<param-name>wrapJSONResponses</param-name>
      			<param-value>false</param-value>
      		</init-param>
      	</servlet>
      	
      	<servlet-mapping>
      		<servlet-name>RESTHandler</servlet-name>
      		<url-pattern>/builtinds/restapi/</url-pattern>
      	</servlet-mapping>
      == MySQL test table and data dump ===================
      Code:
      -- MySQL dump 10.13  Distrib 5.5.21, for Win64 (x86)
      --
      -- Host: localhost    Database: test
      -- ------------------------------------------------------
      -- Server version	5.5.21
      
      /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
      /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
      /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
      /*!40101 SET NAMES utf8 */;
      /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
      /*!40103 SET TIME_ZONE='+00:00' */;
      /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
      /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
      /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
      /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
      
      --
      -- Table structure for table `test`
      --
      
      DROP TABLE IF EXISTS `test`;
      /*!40101 SET @saved_cs_client     = @@character_set_client */;
      /*!40101 SET character_set_client = utf8 */;
      CREATE TABLE `test` (
        `id` int(11) NOT NULL AUTO_INCREMENT,
        `name` varchar(45) NOT NULL,
        `verified` tinyint(1) NOT NULL,
        PRIMARY KEY (`id`)
      ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
      /*!40101 SET character_set_client = @saved_cs_client */;
      
      --
      -- Dumping data for table `test`
      --
      
      LOCK TABLES `test` WRITE;
      /*!40000 ALTER TABLE `test` DISABLE KEYS */;
      INSERT INTO `test` VALUES (5,'verified item',1),(6,'unverified item',0);
      /*!40000 ALTER TABLE `test` ENABLE KEYS */;
      UNLOCK TABLES;
      /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
      
      /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
      /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
      /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
      /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
      /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
      /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
      /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
      
      -- Dump completed on 2012-02-29 18:51:48
      Last edited by davidk; 29 Feb 2012, 03:04.

      Comment


        #4
        Also, when i try by URL GET without using ListGrid, i get the same result

        (1)
        http://127.0.0.1:8888/builtinds/restapi/?verified=true&_startRow=0&_endRow=75&_operationType=fetch&_dataSource=test

        (2)
        http://127.0.0.1:8888/builtinds/restapi/?verified=1&_startRow=0&_endRow=75&_operationType=fetch&_dataSource=test

        Both yields same result:
        {"response":{"endRow":1,"queueStatus":0,"totalRows":1,"isDSResponse":true,"invalidateCache":false,"status":0,"startRow":0,"data":[{"id":6,"verified":false,"name":"unverified item"}]}}

        Comment


          #5
          You haven't mentioned any version information (note what the forums prompts you for when you post).

          If you haven't already, please test with the latest patched version (from smartclient.com/builds).

          Comment


            #6
            Sorry for being careless, here's hopefully enough info:

            1. SmartClient Version: SC_SNAPSHOT-2012-01-09_v8.2p/PowerEdition Deployment (built 2012-01-09)
            (also tested with latest nightly: SmartClient Version: SC_SNAPSHOT-2012-02-29_v8.2p/PowerEdition Deployment (built 2012-02-29))

            2. Browser Firefox 9.0.1

            3. Server side log when making the call :
            http://127.0.0.1:8888/builtinds/restapi/?verified=true&_startRow=0&_endRow=75&_operationType=fetch&_dataSource=test
            Code:
             
            === 2012-03-01 09:53:12,652 [l0-5] DEBUG RequestContext - Paths for request:
            Servlet path: '/builtinds/restapi/'
            Request URI: '/builtinds/restapi/'
            Path Info: 'null'
            Path Translated: 'null'
            Real FileSystem Path: 'C:\lyos_beta_ws_ee\builtinds\war\builtinds\restapi\'
            === 2012-03-01 09:53:12,652 [l0-5] INFO  RequestContext - CGET URL: '/builtinds/restapi/', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1': Moz (Gecko) with Accept-Encoding header
            === 2012-03-01 09:53:12,653 [l0-5] DEBUG Compression - /builtinds/restapi/: Request looks compressable.
            === 2012-03-01 09:53:12,653 [l0-5] DEBUG RequestContext - Paths for request:
            Servlet path: '/builtinds/restapi/'
            Request URI: '/builtinds/restapi/'
            Path Info: 'null'
            Path Translated: 'null'
            Real FileSystem Path: 'C:\lyos_beta_ws_ee\builtinds\war\builtinds\restapi\'
            === 2012-03-01 09:53:12,665 [l0-5] DEBUG RequestContext - Paths for request:
            Servlet path: '/builtinds/restapi/'
            Request URI: '/builtinds/restapi/'
            Path Info: 'null'
            Path Translated: 'null'
            Real FileSystem Path: 'C:\lyos_beta_ws_ee\builtinds\war\builtinds\restapi\'
            === 2012-03-01 09:53:12,666 [l0-5] DEBUG RestRequestParser - Parameter:'_componentId'. Value:'isc_ListGrid_0'.
            === 2012-03-01 09:53:12,666 [l0-5] DEBUG RestRequestParser - Parameter:'_operationType'. Value:'fetch'.
            === 2012-03-01 09:53:12,666 [l0-5] DEBUG RestRequestParser - Parameter:'isc_dataFormat'. Value:'json'.
            === 2012-03-01 09:53:12,669 [l0-5] DEBUG RestRequestParser - Parameter:'verified'. Value:'true'.
            === 2012-03-01 09:53:12,669 [l0-5] DEBUG RestRequestParser - Parameter:'_startRow'. Value:'0'.
            === 2012-03-01 09:53:12,669 [l0-5] DEBUG RestRequestParser - Parameter:'_endRow'. Value:'75'.
            === 2012-03-01 09:53:12,669 [l0-5] DEBUG RestRequestParser - Parameter:'_dataSource'. Value:'test'.
            === 2012-03-01 09:53:12,669 [l0-5] DEBUG RestRequestParser - Parameter:'_textMatchStyle'. Value:'exact'.
            === 2012-03-01 09:53:12,669 [l0-5] DEBUG RestRequestParser - Parameter:'isc_metaDataPrefix'. Value:'_'.
            === 2012-03-01 09:53:12,669 [l0-5] DEBUG DataSource - In DS.forName() for 'test' with DSRequest: null
            === 2012-03-01 09:53:12,672 [l0-5] DEBUG DataStructCache - getInstanceFile (success): 'test' instance of datasources: 2ms
            === 2012-03-01 09:53:12,673 [l0-5] DEBUG InterfaceProvider - Instantiating com.isomorphic.sql.SQLDataSource to satisfy request for an SQLDataSource
            === 2012-03-01 09:53:12,673 [l0-5] DEBUG DataSource - Creating instance of DataSource 'test'
            === 2012-03-01 09:53:12,674 [l0-5] INFO  RESTHandler - Performing 1 operation(s)
            === 2012-03-01 09:53:12,674 [l0-5] DEBUG DataSource - In DS.forName() for 'test' with DSRequest: com.isomorphic.datasource.DSRequest@189727e
            === 2012-03-01 09:53:12,675 [l0-5] DEBUG DataStructCache - getInstanceFile (success): 'test' instance of datasources: 0ms
            === 2012-03-01 09:53:12,675 [l0-5] DEBUG InterfaceProvider - Instantiating com.isomorphic.sql.SQLDataSource to satisfy request for an SQLDataSource
            === 2012-03-01 09:53:12,675 [l0-5] DEBUG DataSource - Creating instance of DataSource 'test'
            === 2012-03-01 09:53:12,680 [l0-5] DEBUG AppBase - [builtinApplication.test_fetch] No userTypes defined, allowing anyone access to all operations for this application
            === 2012-03-01 09:53:12,680 [l0-5] DEBUG AppBase - [builtinApplication.test_fetch] No public zero-argument method named '_test_fetch' found, performing generic datasource operation
            === 2012-03-01 09:53:12,680 [l0-5] DEBUG Timing - [builtinApplication.test_fetch] Time to convert java.util.HashMap to JS Object: 0ms
            === 2012-03-01 09:53:12,681 [l0-5] DEBUG Timing - [builtinApplication.test_fetch] Time to convert java.util.HashMap to JS Object: 0ms
            === 2012-03-01 09:53:12,681 [l0-5] INFO  SQLDataSource - [builtinApplication.test_fetch] Performing fetch operation with
            	criteria: {verified:"true"}	values: {verified:"true"}
            === 2012-03-01 09:53:12,682 [l0-5] INFO  SQLDataSource - [builtinApplication.test_fetch] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
            === 2012-03-01 09:53:12,683 [l0-5] DEBUG SQLDataSource - [builtinApplication.test_fetch] Executing row count query: SELECT COUNT(*) FROM $defaultTableClause WHERE $defaultWhereClause
            === 2012-03-01 09:53:12,683 [l0-5] DEBUG SQLDataSource - [builtinApplication.test_fetch] Eval'd row count query: SELECT COUNT(*) FROM test WHERE (test.verified=0)
            === 2012-03-01 09:53:12,700 [l0-5] DEBUG PoolableSQLConnectionFactory - [builtinApplication.test_fetch] Returning pooled Connection
            === 2012-03-01 09:53:12,700 [l0-5] INFO  SQLDriver - [builtinApplication.test_fetch] Executing SQL query on 'test': SELECT COUNT(*) FROM test WHERE (test.verified=0)
            === 2012-03-01 09:53:12,701 [l0-5] DEBUG Timing - [builtinApplication.test_fetch] SQLTransform (1 rows): 0ms
            === 2012-03-01 09:53:12,701 [l0-5] DEBUG Timing - [builtinApplication.test_fetch] Counted 1 total rows in result set: 18ms
            === 2012-03-01 09:53:12,701 [l0-5] DEBUG SQLDataSource - [builtinApplication.test_fetch] Using SQL Limit query
            === 2012-03-01 09:53:12,701 [l0-5] DEBUG SQLDataSource - [builtinApplication.test_fetch] SQL windowed select rows 0->75, result size 75. Query: SELECT test.id, test.verified, test.name FROM test WHERE (test.verified=0) LIMIT 0, 75
            === 2012-03-01 09:53:12,711 [l0-5] DEBUG PoolableSQLConnectionFactory - [builtinApplication.test_fetch] Returning pooled Connection
            === 2012-03-01 09:53:12,712 [l0-5] DEBUG Timing - [builtinApplication.test_fetch] Time to execute fetch query: 11ms
            === 2012-03-01 09:53:12,712 [l0-5] DEBUG Timing - [builtinApplication.test_fetch] SQLTransform (1 rows): 0ms
            === 2012-03-01 09:53:12,712 [l0-5] DEBUG Timing - [builtinApplication.test_fetch] SQLTransform took: 0ms
            === 2012-03-01 09:53:12,712 [l0-5] INFO  DSResponse - [builtinApplication.test_fetch] DSResponse: List with 1 items
            === 2012-03-01 09:53:12,713 [l0-5] DEBUG Timing - [builtinApplication.test_fetch] Query time: 30ms
            === 2012-03-01 09:53:12,713 [l0-5] DEBUG RequestContext - Setting headers to disable caching
            === 2012-03-01 09:53:12,713 [l0-5] DEBUG RPCManager - Content type for RPC transaction: text/html; charset=UTF-8
            === 2012-03-01 09:53:12,713 [l0-5] DEBUG RequestContext - Getting output stream via servletResponse.getWriter()
            === 2012-03-01 09:53:12,713 [l0-5] DEBUG ProxyHttpServletResponse - Using charset: UTF-8 (CompressionFilter)
            === 2012-03-01 09:53:12,714 [l0-5] DEBUG DataSource - In DS.forName() for 'test' with DSRequest: com.isomorphic.datasource.DSRequest@189727e
            === 2012-03-01 09:53:12,714 [l0-5] DEBUG DataStructCache - getInstanceFile (success): 'test' instance of datasources: 0ms
            === 2012-03-01 09:53:12,714 [l0-5] DEBUG InterfaceProvider - Instantiating com.isomorphic.sql.SQLDataSource to satisfy request for an SQLDataSource
            === 2012-03-01 09:53:12,714 [l0-5] DEBUG DataSource - Creating instance of DataSource 'test'
            === 2012-03-01 09:53:12,714 [l0-5] DEBUG RPCManager - non-DMI response, dropExtraFields: false
            === 2012-03-01 09:53:12,715 [l0-5] DEBUG DataSource - In DS.forName() for 'test' with DSRequest: com.isomorphic.datasource.DSRequest@189727e
            === 2012-03-01 09:53:12,715 [l0-5] DEBUG DataStructCache - getInstanceFile (success): 'test' instance of datasources: 0ms
            === 2012-03-01 09:53:12,715 [l0-5] DEBUG InterfaceProvider - Instantiating com.isomorphic.sql.SQLDataSource to satisfy request for an SQLDataSource
            === 2012-03-01 09:53:12,715 [l0-5] DEBUG DataSource - Creating instance of DataSource 'test'
            === 2012-03-01 09:53:12,715 [l0-5] DEBUG DataSource - In DS.forName() for 'integer' with DSRequest: com.isomorphic.datasource.DSRequest@189727e
            === 2012-03-01 09:53:12,715 [l0-5] DEBUG DataStructCache - getInstanceFile (failure): 'integer' instance of datasources: 0ms
            === 2012-03-01 09:53:12,715 [l0-5] DEBUG DataSource - In DS.forName() for 'boolean' with DSRequest: com.isomorphic.datasource.DSRequest@189727e
            === 2012-03-01 09:53:12,716 [l0-5] DEBUG DataStructCache - getInstanceFile (failure): 'boolean' instance of datasources: 1ms
            === 2012-03-01 09:53:12,716 [l0-5] DEBUG DataSource - In DS.forName() for 'text' with DSRequest: com.isomorphic.datasource.DSRequest@189727e
            === 2012-03-01 09:53:12,716 [l0-5] DEBUG DataStructCache - getInstanceFile (failure): 'text' instance of datasources: 0ms
            === 2012-03-01 09:53:12,716 [l0-5] DEBUG Timing - Time to convert org.apache.commons.collections.map.LinkedMap to JS Object: 1ms
            === 2012-03-01 09:53:12,716 [l0-5] DEBUG Timing - Request: /builtinds/restapi/ (start->finish): 63ms
            === 2012-03-01 09:53:12,716 [l0-5] DEBUG Compression - /builtinds/restapi/: Using upstream-specified mime type: application/json (container-derived mime type was: null)
            === 2012-03-01 09:53:12,716 [l0-5] DEBUG Compression - /builtinds/restapi/: Mime type 'application/json' is not compressable - not compressing
            When tested with ListGrid, the DSrequest produced:
            Code:
            {
                "dataSource":"test", 
                "operationType":"fetch", 
                "componentId":"isc_ListGrid_0", 
                "data":{
                    "verified":true, 
                    "isc_metaDataPrefix":"_", 
                    "isc_dataFormat":"json"
                }, 
                "startRow":0, 
                "endRow":75, 
                "textMatchStyle":"exact", 
                "resultSet":[ResultSet ID:isc_ResultSet_0 (created by: isc_ListGrid_0)], 
                "callback":{
                    "caller":[ResultSet ID:isc_ResultSet_0 (created by: isc_ListGrid_0)], 
                    "methodName":"fetchRemoteDataReply"
                }, 
                "willHandleError":true, 
                "showPrompt":true, 
                "prompt":"Finding Records that match your criteria...", 
                "clientContext":{
                    "requestIndex":3
                }, 
                "requestId":"test$6272"
            }
            And the server log:
            Code:
            === 2012-03-01 09:55:06,973 [l0-5] DEBUG RequestContext - Paths for request:
            Servlet path: '/builtinds/restapi/'
            Request URI: '/builtinds/restapi/'
            Path Info: 'null'
            Path Translated: 'null'
            Real FileSystem Path: 'C:\lyos_beta_ws_ee\builtinds\war\builtinds\restapi\'
            === 2012-03-01 09:55:06,973 [l0-5] INFO  RequestContext - URL: '/builtinds/restapi/', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1': Moz (Gecko) with Accept-Encoding header
            === 2012-03-01 09:55:06,974 [l0-5] DEBUG Compression - /builtinds/restapi/: Request looks compressable.
            === 2012-03-01 09:55:06,974 [l0-5] DEBUG RequestContext - Paths for request:
            Servlet path: '/builtinds/restapi/'
            Request URI: '/builtinds/restapi/'
            Path Info: 'null'
            Path Translated: 'null'
            Real FileSystem Path: 'C:\lyos_beta_ws_ee\builtinds\war\builtinds\restapi\'
            === 2012-03-01 09:55:06,975 [l0-5] DEBUG RequestContext - Paths for request:
            Servlet path: '/builtinds/restapi/'
            Request URI: '/builtinds/restapi/'
            Path Info: 'null'
            Path Translated: 'null'
            Real FileSystem Path: 'C:\lyos_beta_ws_ee\builtinds\war\builtinds\restapi\'
            === 2012-03-01 09:55:06,975 [l0-5] DEBUG RestRequestParser - Parameter:'_operationType'. Value:'fetch'.
            === 2012-03-01 09:55:06,975 [l0-5] DEBUG RestRequestParser - Parameter:'verified'. Value:'true'.
            === 2012-03-01 09:55:06,975 [l0-5] DEBUG RestRequestParser - Parameter:'_startRow'. Value:'0'.
            === 2012-03-01 09:55:06,975 [l0-5] DEBUG RestRequestParser - Parameter:'_endRow'. Value:'75'.
            === 2012-03-01 09:55:06,975 [l0-5] DEBUG RestRequestParser - Parameter:'_dataSource'. Value:'test'.
            === 2012-03-01 09:55:06,975 [l0-5] DEBUG DataSource - In DS.forName() for 'test' with DSRequest: null
            === 2012-03-01 09:55:06,976 [l0-5] DEBUG DataStructCache - getInstanceFile (success): 'test' instance of datasources: 1ms
            === 2012-03-01 09:55:06,976 [l0-5] DEBUG InterfaceProvider - Instantiating com.isomorphic.sql.SQLDataSource to satisfy request for an SQLDataSource
            === 2012-03-01 09:55:06,976 [l0-5] DEBUG DataSource - Creating instance of DataSource 'test'
            === 2012-03-01 09:55:06,976 [l0-5] INFO  RESTHandler - Performing 1 operation(s)
            === 2012-03-01 09:55:06,976 [l0-5] DEBUG DataSource - In DS.forName() for 'test' with DSRequest: com.isomorphic.datasource.DSRequest@714e00
            === 2012-03-01 09:55:06,977 [l0-5] DEBUG DataStructCache - getInstanceFile (success): 'test' instance of datasources: 1ms
            === 2012-03-01 09:55:06,977 [l0-5] DEBUG InterfaceProvider - Instantiating com.isomorphic.sql.SQLDataSource to satisfy request for an SQLDataSource
            === 2012-03-01 09:55:06,977 [l0-5] DEBUG DataSource - Creating instance of DataSource 'test'
            === 2012-03-01 09:55:06,977 [l0-5] DEBUG AppBase - [builtinApplication.test_fetch] No userTypes defined, allowing anyone access to all operations for this application
            === 2012-03-01 09:55:06,977 [l0-5] DEBUG AppBase - [builtinApplication.test_fetch] No public zero-argument method named '_test_fetch' found, performing generic datasource operation
            === 2012-03-01 09:55:06,977 [l0-5] DEBUG Timing - [builtinApplication.test_fetch] Time to convert java.util.HashMap to JS Object: 0ms
            === 2012-03-01 09:55:06,977 [l0-5] DEBUG Timing - [builtinApplication.test_fetch] Time to convert java.util.HashMap to JS Object: 0ms
            === 2012-03-01 09:55:06,977 [l0-5] INFO  SQLDataSource - [builtinApplication.test_fetch] Performing fetch operation with
            	criteria: {verified:"true"}	values: {verified:"true"}
            === 2012-03-01 09:55:06,978 [l0-5] INFO  SQLDataSource - [builtinApplication.test_fetch] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
            === 2012-03-01 09:55:06,978 [l0-5] DEBUG SQLDataSource - [builtinApplication.test_fetch] Executing row count query: SELECT COUNT(*) FROM $defaultTableClause WHERE $defaultWhereClause
            === 2012-03-01 09:55:06,978 [l0-5] DEBUG SQLDataSource - [builtinApplication.test_fetch] Eval'd row count query: SELECT COUNT(*) FROM test WHERE (test.verified=0)
            === 2012-03-01 09:55:06,989 [l0-5] DEBUG PoolableSQLConnectionFactory - [builtinApplication.test_fetch] Returning pooled Connection
            === 2012-03-01 09:55:06,990 [l0-5] INFO  SQLDriver - [builtinApplication.test_fetch] Executing SQL query on 'test': SELECT COUNT(*) FROM test WHERE (test.verified=0)
            === 2012-03-01 09:55:06,991 [l0-5] DEBUG Timing - [builtinApplication.test_fetch] SQLTransform (1 rows): 0ms
            === 2012-03-01 09:55:06,991 [l0-5] DEBUG Timing - [builtinApplication.test_fetch] Counted 1 total rows in result set: 13ms
            === 2012-03-01 09:55:06,991 [l0-5] DEBUG SQLDataSource - [builtinApplication.test_fetch] Using SQL Limit query
            === 2012-03-01 09:55:06,991 [l0-5] DEBUG SQLDataSource - [builtinApplication.test_fetch] SQL windowed select rows 0->75, result size 75. Query: SELECT test.id, test.verified, test.name FROM test WHERE (test.verified=0) LIMIT 0, 75
            === 2012-03-01 09:55:07,000 [l0-5] DEBUG PoolableSQLConnectionFactory - [builtinApplication.test_fetch] Returning pooled Connection
            === 2012-03-01 09:55:07,001 [l0-5] DEBUG Timing - [builtinApplication.test_fetch] Time to execute fetch query: 10ms
            === 2012-03-01 09:55:07,001 [l0-5] DEBUG Timing - [builtinApplication.test_fetch] SQLTransform (1 rows): 0ms
            === 2012-03-01 09:55:07,001 [l0-5] DEBUG Timing - [builtinApplication.test_fetch] SQLTransform took: 0ms
            === 2012-03-01 09:55:07,001 [l0-5] INFO  DSResponse - [builtinApplication.test_fetch] DSResponse: List with 1 items
            === 2012-03-01 09:55:07,001 [l0-5] DEBUG Timing - [builtinApplication.test_fetch] Query time: 23ms
            === 2012-03-01 09:55:07,002 [l0-5] DEBUG RequestContext - Setting headers to disable caching
            === 2012-03-01 09:55:07,002 [l0-5] DEBUG RPCManager - Content type for RPC transaction: text/html; charset=UTF-8
            === 2012-03-01 09:55:07,002 [l0-5] DEBUG RequestContext - Getting output stream via servletResponse.getWriter()
            === 2012-03-01 09:55:07,002 [l0-5] DEBUG ProxyHttpServletResponse - Using charset: UTF-8 (CompressionFilter)
            === 2012-03-01 09:55:07,002 [l0-5] DEBUG DataSource - In DS.forName() for 'test' with DSRequest: com.isomorphic.datasource.DSRequest@714e00
            === 2012-03-01 09:55:07,002 [l0-5] DEBUG DataStructCache - getInstanceFile (success): 'test' instance of datasources: 0ms
            === 2012-03-01 09:55:07,002 [l0-5] DEBUG InterfaceProvider - Instantiating com.isomorphic.sql.SQLDataSource to satisfy request for an SQLDataSource
            === 2012-03-01 09:55:07,002 [l0-5] DEBUG DataSource - Creating instance of DataSource 'test'
            === 2012-03-01 09:55:07,002 [l0-5] DEBUG RPCManager - non-DMI response, dropExtraFields: false
            === 2012-03-01 09:55:07,003 [l0-5] DEBUG DataSource - In DS.forName() for 'test' with DSRequest: com.isomorphic.datasource.DSRequest@714e00
            === 2012-03-01 09:55:07,003 [l0-5] DEBUG DataStructCache - getInstanceFile (success): 'test' instance of datasources: 0ms
            === 2012-03-01 09:55:07,003 [l0-5] DEBUG InterfaceProvider - Instantiating com.isomorphic.sql.SQLDataSource to satisfy request for an SQLDataSource
            === 2012-03-01 09:55:07,003 [l0-5] DEBUG DataSource - Creating instance of DataSource 'test'
            === 2012-03-01 09:55:07,004 [l0-5] DEBUG DataSource - In DS.forName() for 'integer' with DSRequest: com.isomorphic.datasource.DSRequest@714e00
            === 2012-03-01 09:55:07,004 [l0-5] DEBUG DataStructCache - getInstanceFile (failure): 'integer' instance of datasources: 0ms
            === 2012-03-01 09:55:07,004 [l0-5] DEBUG DataSource - In DS.forName() for 'boolean' with DSRequest: com.isomorphic.datasource.DSRequest@714e00
            === 2012-03-01 09:55:07,004 [l0-5] DEBUG DataStructCache - getInstanceFile (failure): 'boolean' instance of datasources: 0ms
            === 2012-03-01 09:55:07,004 [l0-5] DEBUG DataSource - In DS.forName() for 'text' with DSRequest: com.isomorphic.datasource.DSRequest@714e00
            === 2012-03-01 09:55:07,005 [l0-5] DEBUG DataStructCache - getInstanceFile (failure): 'text' instance of datasources: 1ms
            === 2012-03-01 09:55:07,005 [l0-5] DEBUG Timing - Time to convert org.apache.commons.collections.map.LinkedMap to JS Object: 1ms
            === 2012-03-01 09:55:07,005 [l0-5] DEBUG Timing - Request: /builtinds/restapi/ (start->finish): 31ms
            === 2012-03-01 09:55:07,005 [l0-5] DEBUG Compression - /builtinds/restapi/: Using upstream-specified mime type: application/json (container-derived mime type was: null)
            === 2012-03-01 09:55:07,005 [l0-5] DEBUG Compression - /builtinds/restapi/: Mime type 'application/json' is not compressable - not compressing
            === 2012-03-01 09:55:07,025 [l0-5] DEBUG RequestContext - Paths for request:
            Servlet path: '/favicon.ico'
            Request URI: '/favicon.ico'
            Path Info: 'null'
            Path Translated: 'null'
            Real FileSystem Path: 'C:\lyos_beta_ws_ee\builtinds\war\favicon.ico'
            === 2012-03-01 09:55:07,025 [l0-5] INFO  RequestContext - URL: '/favicon.ico', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1': Moz (Gecko) with Accept-Encoding header
            === 2012-03-01 09:55:07,025 [l0-5] DEBUG Compression - /favicon.ico: Mime type 'image/x-icon' is not compressable - not compressing
            4. The response is the same for both requests:
            {"response":{"endRow":1,"queueStatus":0,"totalRows":1,"isDSResponse":true,"invalidateCache":false,"status":0,"startRow":0,"data":[{"id":6,"verified":false,"name":"unverified item"}]}}

            Comment


              #7
              This problem has now been fixed in both 3.0p and 3.1d, but the fix is unlikely to make it into today's nightly builds. Please try with tomorrow's nightly builds (dated March 12th)

              Comment


                #8
                greatly appreciated!

                Comment


                  #9
                  I tried the latest nightly but still got wrong results (same as before).

                  Tested version: SmartClient Version: SC_SNAPSHOT-2012-03-14_v8.2p/PowerEdition Deployment (built 2012-03-14)

                  I sent the following request using Firefox RestClient plugin:

                  http://127.0.0.1:8888/builtinds/restapi/

                  {
                  "dataSource":"test",
                  "operationType":"fetch",
                  "data":{
                  "verified":true
                  },
                  "startRow":0,
                  "endRow":75
                  }

                  The server console:
                  Code:
                  === 2012-03-15 15:46:08,459 [0-11] DEBUG RequestContext - Paths for request:
                  Servlet path: '/builtinds/restapi/'
                  Request URI: '/builtinds/restapi/'
                  Path Info: 'null'
                  Path Translated: 'null'
                  Real FileSystem Path: 'C:\ws_lyos_misc\builtinds\war\builtinds\restapi\'
                  === 2012-03-15 15:46:08,459 [0-11] INFO  RequestContext - URL: '/builtinds/restapi/', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1': Moz (Gecko) with Accept-Encoding header
                  === 2012-03-15 15:46:08,459 [0-11] DEBUG Compression - /builtinds/restapi/: Request looks compressable.
                  === 2012-03-15 15:46:08,459 [0-11] DEBUG RequestContext - Paths for request:
                  Servlet path: '/builtinds/restapi/'
                  Request URI: '/builtinds/restapi/'
                  Path Info: 'null'
                  Path Translated: 'null'
                  Real FileSystem Path: 'C:\ws_lyos_misc\builtinds\war\builtinds\restapi\'
                  === 2012-03-15 15:46:08,459 [0-11] DEBUG RequestContext - Paths for request:
                  Servlet path: '/builtinds/restapi/'
                  Request URI: '/builtinds/restapi/'
                  Path Info: 'null'
                  Path Translated: 'null'
                  Real FileSystem Path: 'C:\ws_lyos_misc\builtinds\war\builtinds\restapi\'
                  === 2012-03-15 15:46:08,460 [0-11] DEBUG RestRequestParser - Parsing json object: '{
                      "dataSource":"test", 
                      "operationType":"fetch", 
                      "data":{
                          "verified":true
                      }, 
                      "startRow":0, 
                      "endRow":75
                  }'
                  === 2012-03-15 15:46:08,460 [0-11] DEBUG InterfaceProvider - Instantiating com.isomorphic.js.parser.JSParser to satisfy request for an IJSParser
                  === 2012-03-15 15:46:08,460 [0-11] DEBUG DataSource - In DS.forName() for 'test' with DSRequest: null
                  === 2012-03-15 15:46:08,463 [0-11] DEBUG DataStructCache - getInstanceFile (success): 'test' instance of datasources: 3ms
                  === 2012-03-15 15:46:08,465 [0-11] DEBUG InterfaceProvider - Instantiating com.isomorphic.sql.SQLDataSource to satisfy request for an SQLDataSource
                  === 2012-03-15 15:46:08,465 [0-11] DEBUG DataSource - Creating instance of DataSource 'test'
                  === 2012-03-15 15:46:08,465 [0-11] INFO  RESTHandler - Performing 1 operation(s)
                  === 2012-03-15 15:46:08,465 [0-11] DEBUG DataSource - In DS.forName() for 'test' with DSRequest: com.isomorphic.datasource.DSRequest@175e720
                  === 2012-03-15 15:46:08,465 [0-11] DEBUG DataStructCache - getInstanceFile (success): 'test' instance of datasources: 0ms
                  === 2012-03-15 15:46:08,465 [0-11] DEBUG InterfaceProvider - Instantiating com.isomorphic.sql.SQLDataSource to satisfy request for an SQLDataSource
                  === 2012-03-15 15:46:08,465 [0-11] DEBUG DataSource - Creating instance of DataSource 'test'
                  === 2012-03-15 15:46:08,465 [0-11] DEBUG AppBase - [builtinApplication.test_fetch] No userTypes defined, allowing anyone access to all operations for this application
                  === 2012-03-15 15:46:08,465 [0-11] DEBUG AppBase - [builtinApplication.test_fetch] No public zero-argument method named '_test_fetch' found, performing generic datasource operation
                  === 2012-03-15 15:46:08,468 [0-11] DEBUG Timing - [builtinApplication.test_fetch] Time to convert org.apache.commons.collections.map.LinkedMap to JS Object: 0ms
                  === 2012-03-15 15:46:08,468 [0-11] DEBUG Timing - [builtinApplication.test_fetch] Time to convert org.apache.commons.collections.map.LinkedMap to JS Object: 0ms
                  === 2012-03-15 15:46:08,468 [0-11] INFO  SQLDataSource - [builtinApplication.test_fetch] Performing fetch operation with
                  	criteria: {verified:"true"}	values: {verified:"true"}
                  === 2012-03-15 15:46:08,468 [0-11] INFO  SQLDataSource - [builtinApplication.test_fetch] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
                  === 2012-03-15 15:46:08,468 [0-11] DEBUG SQLDataSource - [builtinApplication.test_fetch] Executing row count query: SELECT COUNT(*) FROM $defaultTableClause WHERE $defaultWhereClause
                  === 2012-03-15 15:46:08,468 [0-11] DEBUG SQLDataSource - [builtinApplication.test_fetch] Eval'd row count query: SELECT COUNT(*) FROM test WHERE (test.verified=0)
                  === 2012-03-15 15:46:08,485 [0-11] DEBUG PoolableSQLConnectionFactory - [builtinApplication.test_fetch] Returning pooled Connection
                  === 2012-03-15 15:46:08,485 [0-11] INFO  SQLDriver - [builtinApplication.test_fetch] Executing SQL query on 'test': SELECT COUNT(*) FROM test WHERE (test.verified=0)
                  === 2012-03-15 15:46:08,485 [0-11] DEBUG Timing - [builtinApplication.test_fetch] SQLTransform (1 rows): 0ms
                  === 2012-03-15 15:46:08,488 [0-11] DEBUG Timing - [builtinApplication.test_fetch] Counted 1 total rows in result set: 20ms
                  === 2012-03-15 15:46:08,488 [0-11] DEBUG SQLDataSource - [builtinApplication.test_fetch] Using SQL Limit query
                  === 2012-03-15 15:46:08,488 [0-11] DEBUG SQLDataSource - [builtinApplication.test_fetch] SQL windowed select rows 0->75, result size 75. Query: SELECT test.id, test.verified, test.name FROM test WHERE (test.verified=0) LIMIT 0, 75
                  === 2012-03-15 15:46:08,495 [0-11] DEBUG PoolableSQLConnectionFactory - [builtinApplication.test_fetch] Returning pooled Connection
                  === 2012-03-15 15:46:08,498 [0-11] DEBUG Timing - [builtinApplication.test_fetch] Time to execute fetch query: 10ms
                  === 2012-03-15 15:46:08,498 [0-11] DEBUG Timing - [builtinApplication.test_fetch] SQLTransform (1 rows): 0ms
                  === 2012-03-15 15:46:08,498 [0-11] DEBUG Timing - [builtinApplication.test_fetch] SQLTransform took: 0ms
                  === 2012-03-15 15:46:08,498 [0-11] INFO  DSResponse - [builtinApplication.test_fetch] DSResponse: List with 1 items
                  === 2012-03-15 15:46:08,498 [0-11] DEBUG Timing - [builtinApplication.test_fetch] Query time: 30ms
                  === 2012-03-15 15:46:08,498 [0-11] DEBUG RequestContext - Setting headers to disable caching
                  === 2012-03-15 15:46:08,503 [0-11] DEBUG RPCManager - Content type for RPC transaction: text/html; charset=UTF-8
                  === 2012-03-15 15:46:08,503 [0-11] DEBUG RequestContext - Getting output stream via servletResponse.getWriter()
                  === 2012-03-15 15:46:08,503 [0-11] DEBUG ProxyHttpServletResponse - Using charset: UTF-8 (CompressionFilter)
                  === 2012-03-15 15:46:08,503 [0-11] DEBUG DataSource - In DS.forName() for 'test' with DSRequest: com.isomorphic.datasource.DSRequest@175e720
                  === 2012-03-15 15:46:08,503 [0-11] DEBUG DataStructCache - getInstanceFile (success): 'test' instance of datasources: 0ms
                  === 2012-03-15 15:46:08,503 [0-11] DEBUG InterfaceProvider - Instantiating com.isomorphic.sql.SQLDataSource to satisfy request for an SQLDataSource
                  === 2012-03-15 15:46:08,503 [0-11] DEBUG DataSource - Creating instance of DataSource 'test'
                  === 2012-03-15 15:46:08,503 [0-11] DEBUG RPCManager - non-DMI response, dropExtraFields: false
                  === 2012-03-15 15:46:08,505 [0-11] DEBUG DataSource - In DS.forName() for 'test' with DSRequest: com.isomorphic.datasource.DSRequest@175e720
                  === 2012-03-15 15:46:08,505 [0-11] DEBUG DataStructCache - getInstanceFile (success): 'test' instance of datasources: 0ms
                  === 2012-03-15 15:46:08,505 [0-11] DEBUG InterfaceProvider - Instantiating com.isomorphic.sql.SQLDataSource to satisfy request for an SQLDataSource
                  === 2012-03-15 15:46:08,505 [0-11] DEBUG DataSource - Creating instance of DataSource 'test'
                  === 2012-03-15 15:46:08,505 [0-11] DEBUG DataSource - In DS.forName() for 'integer' with DSRequest: com.isomorphic.datasource.DSRequest@175e720
                  === 2012-03-15 15:46:08,505 [0-11] DEBUG DataStructCache - getInstanceFile (failure): 'integer' instance of datasources: 0ms
                  === 2012-03-15 15:46:08,505 [0-11] DEBUG DataSource - In DS.forName() for 'boolean' with DSRequest: com.isomorphic.datasource.DSRequest@175e720
                  === 2012-03-15 15:46:08,505 [0-11] DEBUG DataStructCache - getInstanceFile (failure): 'boolean' instance of datasources: 0ms
                  === 2012-03-15 15:46:08,505 [0-11] DEBUG DataSource - In DS.forName() for 'text' with DSRequest: com.isomorphic.datasource.DSRequest@175e720
                  === 2012-03-15 15:46:08,508 [0-11] DEBUG DataStructCache - getInstanceFile (failure): 'text' instance of datasources: 3ms
                  === 2012-03-15 15:46:08,508 [0-11] DEBUG Timing - Time to convert org.apache.commons.collections.map.LinkedMap to JS Object: 3ms
                  === 2012-03-15 15:46:08,508 [0-11] DEBUG Timing - Request: /builtinds/restapi/ (start->finish): 49ms
                  === 2012-03-15 15:46:08,508 [0-11] DEBUG Compression - /builtinds/restapi/: Using upstream-specified mime type: application/json (container-derived mime type was: null)
                  === 2012-03-15 15:46:08,508 [0-11] DEBUG Compression - /builtinds/restapi/: Mime type 'application/json' is not compressable - not compressing

                  Comment


                    #10
                    Hmm, can't explain this - it's working OK for us. Can you please try a completely clean project based on the 3/14 build you mention; it seems most likely this is a config problem.

                    Comment

                    Working...
                    X