Announcement

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

    Questions about DSRequest & transaction

    related datasoure code:
    Code:
     	
    <operationBinding operationType="add" > 			
    <values fieldName="requestId" value="$responseData.last('requestDS',add).requestId" />
    </operationBinding>

    my scenario is just like the official sample named "Master/Detail Add",
    I put this two "add" DSrequest in one queue,shown as below:
    Code:
            isc.RPCManager.startQueue();
            editForm.saveData();
            requestItemList.saveAllEdits();
            isc.RPCManager.sendQueue();
    when queue start, the first "add" DSrequest status is success,
    the second "add" DSrequest status is failure

    error code quoted:
    Code:
    Invocation of method 'last' in  class com.isomorphic.velocity.ResponseDataHandler threw exception java.lang.IndexOutOfBoundsException: 
    Index: 0, Size: 0 at notProvided[line 1, column 15]
    But i find that the first "add" operaion has been comitted to DataBase with one new record inserted though second DSrequest is fail,
    which means this transaciton dose not roll-back .

    please help me with this problem,thanks!
    Attached Files
    Last edited by noodles; 5 May 2010, 00:20.

    #2
    Hello, I am wondering if anyone else is having this problem. I am trying to achieve the same thing as noodles and I am getting the same exact error message:

    Code:
    Invocation of method 'last' in  class
    com.isomorphic.velocity.ResponseDataHandler threw exception
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at 
    notProvided[line 1, column 15]

    Comment


      #3
      This implies there is no previous request in the queue. Both you and noodles would need to post more complete information (including server-side logs, contents of RPC tab in Developer Console).

      Comment


        #4
        Thanks for the reply. I have got the error to go away, and have got both inserts to go into the database correctly. I think the issue was that I was using a cacheSyncOperation on the first table that did a join with the second table. Once I changed the datasource to use the default fetch for the cacheSyncOperation the error is gone. This is not how I would like it to work though, because I really want to use my original cacheSyncOperation to update a grid with the newly inserted records. Does that make sense?

        Comment


          #5
          That doesn't really explain the problem. Can you reproduce the problem from the "Queued Master/Detail Add" sample by adding settings?

          Comment


            #6
            Yes, I am able to reproduce this with the "Queued Master/Detail Add" sample. Would you like me to upload an entire eclipse project? Or just paste code snipits? I have modified the main class, and the queuedAdd_Order.ds.xml. Also I had to add a DMI handler for "queuedAdd_Order" even though I haven't added any functions in it.

            Comment


              #7
              What would be ideal is just posting the minimal changes need to make something go wrong.

              Comment


                #8
                Ok. Here are the minimal changes.

                Step 1: add the following Listgrid to the QueuedMasterDetailAddSample class:

                Code:
                final ListGrid joinGrid = new ListGrid();
                joinGrid.setHeight(224);
                joinGrid.setWidth(400);
                joinGrid.setDataSource(queuedAddOrderDS);
                joinGrid.setAutoFetchData(true);
                joinGrid.setFetchOperation("customFetch");
                Also comment out the SC.say("Order saved.... line because it hinders the error message


                Step 2: Modify the end of queuedAdd_order.ds.xml and add the following lines

                Code:
                      <field name="quantity" type="integer" tableName="queuedOrderItem"></field>
                </fields>
                
                <serverObject lookupStyle="new" className="com.smartgwt.sample.server.EmptyClass"/>
                
                <operationBindings>
                	<operationBinding operationType="fetch" operationId="customFetch">
                		<tableClause>queuedOrder, queuedOrderItem</tableClause>
                		<whereClause>queuedOrder.orderId = queuedOrderItem.orderId AND ($defaultWhereClause)</whereClause>
                	</operationBinding>
                
                	<operationBinding operationType="add" cacheSyncOperation="customFetch">
                	</operationBinding>
                </operationBindings>

                I got an error about needing to create a server object, so I created a DMI class "EmptyClass", although there are no functions in it.


                If you run it with these changes you will get the error noodles described once you click the "Save Order" button.

                If you comment out:

                Code:
                	<operationBinding operationType="add" cacheSyncOperation="customFetch">
                	</operationBinding>
                so the cacheSync uses the default fetch, you will not get an error, but you will see the Quantity field will never get updated on the list grid.

                Thanks for the help and let me know if you need any more information.
                Last edited by wolf; 22 May 2012, 10:47.

                Comment


                  #9
                  As configured, what's happening is that you've defined a DMI that does nothing, so the first operation never executes at all. Removing the no-op DMI should fix this issue.

                  If there's a way to reproduce this that doesn't involve such a problem, please let us know.

                  Also, versions were never mentioned - please be sure to include versions and test with the latest patch build (from smartclient.com/builds).

                  Comment


                    #10
                    I downloaded a new SmartGWT 3.0 EE evaluation from to make sure this was not an issue you have recently patched. SmartClient Version: v8.2p_2012-05-22/EVAL Deployment

                    Here is the log for when I comment out the serverObject from the XML and try to use the add operation with the cacheSyncOperation="customFetch". Just to be clear you are saying no java server code needs to be written?


                    Code:
                    === 2012-05-22 15:06:17,013 [0-16] INFO  RequestContext - URL: '/dsdmi/sc/IDACall', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2': Moz (Gecko) with Accept-Encoding header
                    === 2012-05-22 15:06:17,015 [0-16] DEBUG XML - Parsed XML from (in memory stream): 1ms
                    === 2012-05-22 15:06:17,017 [0-16] DEBUG RPCManager - Processing 2 requests.
                    === 2012-05-22 15:06:17,017 [0-16] WARN  DataStructCache - File queuedAdd_order.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                    === 2012-05-22 15:06:17,018 [0-16] DEBUG RPCManager - Request #1 (DSRequest) payload: {
                        values:{
                            orderDate:new Date(1337659200000),
                            customerName:"cust1"
                        },
                        operationConfig:{
                            dataSource:"queuedAdd_order",
                            operationType:"add"
                        },
                        componentId:"isc_DynamicForm_0",
                        appID:"builtinApplication",
                        operation:"queuedAdd_order_add",
                        oldValues:{
                        },
                        criteria:{
                        }
                    }
                    === 2012-05-22 15:06:17,018 [0-16] WARN  DataStructCache - File queuedAdd_orderItem.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                    === 2012-05-22 15:06:17,019 [0-16] DEBUG RPCManager - Request #2 (DSRequest) payload: {
                        values:{
                            quantity:1,
                            categoryName:"Accessories",
                            itemName:"Magnetic Letters Quartet 25mm (1)"
                        },
                        operationConfig:{
                            dataSource:"queuedAdd_orderItem",
                            operationType:"add"
                        },
                        componentId:"isc_ListGrid_1",
                        appID:"builtinApplication",
                        operation:"queuedAdd_orderItem_add",
                        oldValues:{
                            quantity:1,
                            categoryName:"Accessories",
                            itemName:"Magnetic Letters Quartet 25mm (1)"
                        },
                        criteria:{
                        }
                    }
                    === 2012-05-22 15:06:17,019 [0-16] INFO  IDACall - Performing 2 operation(s)
                    === 2012-05-22 15:06:17,019 [0-16] WARN  RequestContext - dsRequest.execute() failed: 
                    java.lang.Exception: Can't find serverObject for operationBinding for DataSource: queuedAdd_order with operationType: addqueuedAdd_order_add - you must define a <serverObject> in the <operationBinding> or provide a default one at the same level as the <operationBindings> declaration.
                    	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:212)
                    	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)
                    === 2012-05-22 15:06:17,020 [0-16] WARN  DataStructCache - File queuedAdd_order.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                    === 2012-05-22 15:06:17,022 [0-16] DEBUG AppBase - [builtinApplication.queuedAdd_orderItem_add] No userTypes defined, allowing anyone access to all operations for this application
                    === 2012-05-22 15:06:17,022 [0-16] DEBUG AppBase - [builtinApplication.queuedAdd_orderItem_add] No public zero-argument method named '_queuedAdd_orderItem_add' found, performing generic datasource operation
                    === 2012-05-22 15:06:17,024 [0-16] DEBUG ValidationContext - [builtinApplication.queuedAdd_orderItem_add] Adding validation errors at path '/queuedAdd_orderItem/orderID': {errorMessage=Must be a whole number.}
                    === 2012-05-22 15:06:17,025 [0-16] INFO  Validation - [builtinApplication.queuedAdd_orderItem_add] Validation error: [
                        {
                            orderID:{
                                errorMessage:"Must be a whole number."
                            }
                        }
                    ]
                    === 2012-05-22 15:06:17,025 [0-16] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
                    === 2012-05-22 15:06:17,025 [0-16] WARN  DataStructCache - File queuedAdd_order.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                    === 2012-05-22 15:06:17,026 [0-16] DEBUG RPCManager - non-DMI response, dropExtraFields: false
                    === 2012-05-22 15:06:17,026 [0-16] WARN  DataStructCache - File queuedAdd_orderItem.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                    === 2012-05-22 15:06:17,026 [0-16] DEBUG RPCManager - non-DMI response, dropExtraFields: false
                    === 2012-05-22 15:06:17,027 [0-16] INFO  Compression - /dsdmi/sc/IDACall: 541 -> 312 bytes
                    === 2012-05-22 15:06:17,138 [0-16] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\wolf\smartgwtee-3.0p\samples\ds-dmi\war\dsdmi\sc\skins\Enterprise\images\Dialog\warn.png
                    === 2012-05-22 15:06:17,138 [l0-9] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\wolf\smartgwtee-3.0p\samples\ds-dmi\war\dsdmi\sc\skins\Enterprise\images\headerIcons\close.png
                    === 2012-05-22 15:06:17,147 [0-11] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\wolf\smartgwtee-3.0p\samples\ds-dmi\war\dsdmi\sc\skins\Enterprise\images\Window\window_TR.png
                    === 2012-05-22 15:06:17,149 [l0-7] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\wolf\smartgwtee-3.0p\samples\ds-dmi\war\dsdmi\sc\skins\Enterprise\images\Window\window_L.png
                    === 2012-05-22 15:06:17,149 [0-11] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\wolf\smartgwtee-3.0p\samples\ds-dmi\war\dsdmi\sc\skins\Enterprise\images\Window\window_B.png
                    === 2012-05-22 15:06:17,154 [l0-2] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\wolf\smartgwtee-3.0p\samples\ds-dmi\war\dsdmi\sc\skins\Enterprise\images\Window\window_R.png
                    === 2012-05-22 15:06:17,156 [l0-9] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\wolf\smartgwtee-3.0p\samples\ds-dmi\war\dsdmi\sc\skins\Enterprise\images\Window\window_TL.png
                    === 2012-05-22 15:06:17,147 [0-12] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\wolf\smartgwtee-3.0p\samples\ds-dmi\war\dsdmi\sc\skins\Enterprise\images\Window\window_BL.png
                    === 2012-05-22 15:06:17,156 [l0-7] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\wolf\smartgwtee-3.0p\samples\ds-dmi\war\dsdmi\sc\skins\Enterprise\images\Window\window_BR.png
                    === 2012-05-22 15:06:17,154 [0-16] INFO  Download - Returning 304: Not modified on conditional get of: C:\Users\wolf\smartgwtee-3.0p\samples\ds-dmi\war\dsdmi\sc\skins\Enterprise\images\Window\window_T.png

                    Here is the log for when I do have the empty server object and try to use the customCacheSync (noodles error)

                    Code:
                    === 2012-05-22 15:09:56,773 [l0-0] INFO  RequestContext - URL: '/dsdmi/sc/IDACall', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2': Moz (Gecko) with Accept-Encoding header
                    === 2012-05-22 15:09:56,776 [l0-0] DEBUG XML - Parsed XML from (in memory stream): 2ms
                    === 2012-05-22 15:09:56,778 [l0-0] DEBUG RPCManager - Processing 2 requests.
                    === 2012-05-22 15:09:56,778 [l0-0] WARN  DataStructCache - File queuedAdd_order.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                    === 2012-05-22 15:09:56,779 [l0-0] DEBUG RPCManager - Request #1 (DSRequest) payload: {
                        values:{
                            orderDate:new Date(1337659200000),
                            customerName:"cust2"
                        },
                        operationConfig:{
                            dataSource:"queuedAdd_order",
                            operationType:"add"
                        },
                        componentId:"isc_DynamicForm_0",
                        appID:"builtinApplication",
                        operation:"queuedAdd_order_add",
                        oldValues:{
                        },
                        criteria:{
                        }
                    }
                    === 2012-05-22 15:09:56,779 [l0-0] WARN  DataStructCache - File queuedAdd_orderItem.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                    === 2012-05-22 15:09:56,780 [l0-0] DEBUG RPCManager - Request #2 (DSRequest) payload: {
                        values:{
                            quantity:1,
                            categoryName:"Adding Machine/calculator Roll",
                            itemName:"Adding Machine Roll 57x57mm Standard"
                        },
                        operationConfig:{
                            dataSource:"queuedAdd_orderItem",
                            operationType:"add"
                        },
                        componentId:"isc_ListGrid_1",
                        appID:"builtinApplication",
                        operation:"queuedAdd_orderItem_add",
                        oldValues:{
                            quantity:1,
                            categoryName:"Adding Machine/calculator Roll",
                            itemName:"Adding Machine Roll 57x57mm Standard"
                        },
                        criteria:{
                        }
                    }
                    === 2012-05-22 15:09:56,780 [l0-0] INFO  IDACall - Performing 2 operation(s)
                    === 2012-05-22 15:09:56,780 [l0-0] DEBUG ServerObject - Couldn't find a public method named: add on class: com.smartgwt.sample.server.EmptyClass
                    === 2012-05-22 15:09:56,785 [l0-0] DEBUG DataSourceDMI - DataSourceDMI: no public method name: add available on class: com.smartgwt.sample.server.EmptyClass - defaulting to builtin operations.
                    === 2012-05-22 15:09:56,785 [l0-0] DEBUG AppBase - [builtinApplication.queuedAdd_order_add] No userTypes defined, allowing anyone access to all operations for this application
                    === 2012-05-22 15:09:56,785 [l0-0] DEBUG AppBase - [builtinApplication.queuedAdd_order_add] No public zero-argument method named '_queuedAdd_order_add' found, performing generic datasource operation
                    === 2012-05-22 15:09:56,786 [l0-0] INFO  SQLDataSource - [builtinApplication.queuedAdd_order_add] Performing add operation with
                    	criteria: {orderDate:new Date(1337659200000),customerName:"cust2"}	values: {orderDate:new Date(1337659200000),customerName:"cust2"}
                    === 2012-05-22 15:09:56,790 [l0-0] DEBUG SQLValuesClause - [builtinApplication.queuedAdd_order_add] Sequences: {orderID=__default}
                    === 2012-05-22 15:09:56,792 [l0-0] DEBUG PoolableSQLConnectionFactory - [builtinApplication.queuedAdd_order_add] DriverManager fetching connection for HSQLDB via jdbc url jdbc:hsqldb:hsql://localhost/isomorphic
                    === 2012-05-22 15:09:56,792 [l0-0] DEBUG PoolableSQLConnectionFactory - [builtinApplication.queuedAdd_order_add] Passing JDBC URL only to getConnection
                    === 2012-05-22 15:09:56,793 [l0-0] DEBUG PoolableSQLConnectionFactory - [builtinApplication.queuedAdd_order_add] Returning unpooled Connection
                    === 2012-05-22 15:09:56,793 [l0-0] DEBUG SQLTransaction - [builtinApplication.queuedAdd_order_add] Started new HSQLDB transaction "1045550228"
                    === 2012-05-22 15:09:56,793 [l0-0] INFO  SQLDriver - [builtinApplication.queuedAdd_order_add] Executing SQL update on 'HSQLDB': INSERT INTO queuedOrder (customerName, orderDate, orderID) VALUES ('cust2', '2012-05-22 00:00:00', null)
                    === 2012-05-22 15:09:56,796 [l0-0] DEBUG SQLDataSource - [builtinApplication.queuedAdd_order_add] add operation affected 1 rows
                    === 2012-05-22 15:09:56,796 [l0-0] DEBUG HSQLDBDriver - [builtinApplication.queuedAdd_order_add] fetchLastRow data - primaryKeysPresent: {}sequencesNotPresent: [orderID]
                    === 2012-05-22 15:09:56,796 [l0-0] INFO  SQLDriver - [builtinApplication.queuedAdd_order_add] Executing SQL query on 'HSQLDB': CALL IDENTITY()
                    === 2012-05-22 15:09:56,796 [l0-0] INFO  SQLDataSource - [builtinApplication.queuedAdd_order_add] primaryKeys: {orderID=3}
                    === 2012-05-22 15:09:56,796 [l0-0] INFO  SQLDataSource - [builtinApplication.queuedAdd_order_add] HSQLDB getLastRow(): using specific cacheSyncOperation customFetch
                    === 2012-05-22 15:09:56,796 [l0-0] WARN  DataStructCache - [builtinApplication.queuedAdd_order_add] File queuedAdd_order.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                    === 2012-05-22 15:09:56,797 [l0-0] DEBUG ServerObject - [builtinApplication.queuedAdd_order_add] Couldn't find a public method named: fetch on class: com.smartgwt.sample.server.EmptyClass
                    === 2012-05-22 15:09:56,797 [l0-0] DEBUG DataSourceDMI - [builtinApplication.queuedAdd_order_add] DataSourceDMI: no public method name: fetch available on class: com.smartgwt.sample.server.EmptyClass - defaulting to builtin operations.
                    === 2012-05-22 15:09:56,797 [l0-0] DEBUG AppBase - [builtinApplication.queuedAdd_order_add, builtinApplication.customFetch] No userTypes defined, allowing anyone access to all operations for this application
                    === 2012-05-22 15:09:56,797 [l0-0] DEBUG AppBase - [builtinApplication.queuedAdd_order_add, builtinApplication.customFetch] No public zero-argument method named '_customFetch' found, performing generic datasource operation
                    === 2012-05-22 15:09:56,798 [l0-0] INFO  SQLDataSource - [builtinApplication.queuedAdd_order_add, builtinApplication.customFetch] Performing fetch operation with
                    	criteria: {orderID:3}	values: {orderID:3}
                    === 2012-05-22 15:09:56,798 [l0-0] INFO  SQLDataSource - [builtinApplication.queuedAdd_order_add, builtinApplication.customFetch] derived query: SELECT $defaultSelectClause FROM queuedOrder, queuedOrderItem WHERE queuedOrder.orderId = queuedOrderItem.orderId AND ($defaultWhereClause)
                    === 2012-05-22 15:09:56,798 [l0-0] INFO  SQLDataSource - [builtinApplication.queuedAdd_order_add, builtinApplication.customFetch] Executing SQL query on 'HSQLDB': SELECT queuedOrder.customerName, queuedOrder.customerRef, queuedOrder.orderDate, queuedOrder.orderID, queuedOrderItem.quantity, queuedOrder.shippingCost FROM queuedOrder, queuedOrderItem WHERE queuedOrder.orderId = queuedOrderItem.orderId AND ((queuedOrder.orderID='3'))
                    === 2012-05-22 15:09:56,798 [l0-0] INFO  SQLDriver - [builtinApplication.queuedAdd_order_add, builtinApplication.customFetch] Executing SQL query on 'HSQLDB': SELECT queuedOrder.customerName, queuedOrder.customerRef, queuedOrder.orderDate, queuedOrder.orderID, queuedOrderItem.quantity, queuedOrder.shippingCost FROM queuedOrder, queuedOrderItem WHERE queuedOrder.orderId = queuedOrderItem.orderId AND ((queuedOrder.orderID='3'))
                    === 2012-05-22 15:09:56,799 [l0-0] INFO  DSResponse - [builtinApplication.queuedAdd_order_add, builtinApplication.customFetch] DSResponse: List with 0 items
                    === 2012-05-22 15:09:56,799 [l0-0] INFO  DSResponse - [builtinApplication.queuedAdd_order_add] DSResponse: List with 0 items
                    === 2012-05-22 15:09:56,806 [l0-0] WARN  RequestContext - dsRequest.execute() failed: 
                    org.apache.velocity.exception.MethodInvocationException: Invocation of method 'last' in  class com.isomorphic.velocity.ResponseDataHandler threw exception java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at notProvided[line 1, column 15]
                    	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:212)
                    	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)
                    Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
                    	at java.util.ArrayList.RangeCheck(Unknown Source)
                    	at java.util.ArrayList.get(Unknown Source)
                    	at com.isomorphic.rpc.RPCManager.findResponseData(RPCManager.java:2301)
                    	at com.isomorphic.velocity.ResponseDataHandler.last(ResponseDataHandler.java:111)
                    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                    	at java.lang.reflect.Method.invoke(Unknown Source)
                    	at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
                    	at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
                    	at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
                    	at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:252)
                    	at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:332)
                    	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
                    	at org.apache.velocity.runtime.RuntimeInstance.render(RuntimeInstance.java:1277)
                    	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1216)
                    	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1165)
                    	at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:219)
                    	at com.isomorphic.velocity.Velocity.evaluate(Velocity.java:210)
                    	at com.isomorphic.velocity.Velocity.evaluate(Velocity.java:157)
                    	at com.isomorphic.rpc.RPCManager.applyEarlierResponseValues(RPCManager.java:2216)
                    	at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1915)
                    	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:199)
                    	... 26 more
                    === 2012-05-22 15:09:56,806 [l0-0] WARN  DataStructCache - File queuedAdd_orderItem.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                    === 2012-05-22 15:09:56,807 [l0-0] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
                    === 2012-05-22 15:09:56,807 [l0-0] DEBUG SQLTransaction - Rolling back HSQLDB transaction "1045550228"
                    === 2012-05-22 15:09:56,807 [l0-0] WARN  DataStructCache - File queuedAdd_order.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                    === 2012-05-22 15:09:56,808 [l0-0] DEBUG RPCManager - non-DMI response, dropExtraFields: false
                    === 2012-05-22 15:09:56,808 [l0-0] WARN  DataStructCache - File queuedAdd_orderItem.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                    === 2012-05-22 15:09:56,809 [l0-0] DEBUG RPCManager - non-DMI response, dropExtraFields: false
                    === 2012-05-22 15:09:56,809 [l0-0] DEBUG SQLTransaction - Ending HSQLDB transaction "1045550228"
                    === 2012-05-22 15:09:56,812 [l0-0] INFO  Compression - /dsdmi/sc/IDACall: 403 -> 267 bytes
                    Finally here is the log for when I do have the empty server object and try to use the normal add operation with no customCacheSync. This operation works with no errors but, the quantity field will not be populated for the new record on the grid.

                    Code:
                    === 2012-05-22 15:13:51,911 [l0-0] INFO  RequestContext - URL: '/dsdmi/sc/IDACall', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2': Moz (Gecko) with Accept-Encoding header
                    === 2012-05-22 15:13:51,914 [l0-0] DEBUG XML - Parsed XML from (in memory stream): 2ms
                    === 2012-05-22 15:13:51,916 [l0-0] DEBUG RPCManager - Processing 2 requests.
                    === 2012-05-22 15:13:51,916 [l0-0] WARN  DataStructCache - File queuedAdd_order.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                    === 2012-05-22 15:13:51,917 [l0-0] DEBUG RPCManager - Request #1 (DSRequest) payload: {
                        values:{
                            orderDate:new Date(1337659200000),
                            customerName:"cust3"
                        },
                        operationConfig:{
                            dataSource:"queuedAdd_order",
                            operationType:"add"
                        },
                        componentId:"isc_DynamicForm_0",
                        appID:"builtinApplication",
                        operation:"queuedAdd_order_add",
                        oldValues:{
                        },
                        criteria:{
                        }
                    }
                    === 2012-05-22 15:13:51,917 [l0-0] WARN  DataStructCache - File queuedAdd_orderItem.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                    === 2012-05-22 15:13:51,918 [l0-0] DEBUG RPCManager - Request #2 (DSRequest) payload: {
                        values:{
                            quantity:1,
                            categoryName:"Alpha/letter/numeric",
                            itemName:"Label Alpha Sheet Coding Pkt 180 L"
                        },
                        operationConfig:{
                            dataSource:"queuedAdd_orderItem",
                            operationType:"add"
                        },
                        componentId:"isc_ListGrid_1",
                        appID:"builtinApplication",
                        operation:"queuedAdd_orderItem_add",
                        oldValues:{
                            quantity:1,
                            categoryName:"Alpha/letter/numeric",
                            itemName:"Label Alpha Sheet Coding Pkt 180 L"
                        },
                        criteria:{
                        }
                    }
                    === 2012-05-22 15:13:51,918 [l0-0] INFO  IDACall - Performing 2 operation(s)
                    === 2012-05-22 15:13:51,919 [l0-0] DEBUG ServerObject - Couldn't find a public method named: add on class: com.smartgwt.sample.server.EmptyClass
                    === 2012-05-22 15:13:51,922 [l0-0] DEBUG DataSourceDMI - DataSourceDMI: no public method name: add available on class: com.smartgwt.sample.server.EmptyClass - defaulting to builtin operations.
                    === 2012-05-22 15:13:51,922 [l0-0] DEBUG AppBase - [builtinApplication.queuedAdd_order_add] No userTypes defined, allowing anyone access to all operations for this application
                    === 2012-05-22 15:13:51,922 [l0-0] DEBUG AppBase - [builtinApplication.queuedAdd_order_add] No public zero-argument method named '_queuedAdd_order_add' found, performing generic datasource operation
                    === 2012-05-22 15:13:51,923 [l0-0] INFO  SQLDataSource - [builtinApplication.queuedAdd_order_add] Performing add operation with
                    	criteria: {orderDate:new Date(1337659200000),customerName:"cust3"}	values: {orderDate:new Date(1337659200000),customerName:"cust3"}
                    === 2012-05-22 15:13:51,928 [l0-0] DEBUG SQLValuesClause - [builtinApplication.queuedAdd_order_add] Sequences: {orderID=__default}
                    === 2012-05-22 15:13:51,930 [l0-0] DEBUG PoolableSQLConnectionFactory - [builtinApplication.queuedAdd_order_add] DriverManager fetching connection for HSQLDB via jdbc url jdbc:hsqldb:hsql://localhost/isomorphic
                    === 2012-05-22 15:13:51,930 [l0-0] DEBUG PoolableSQLConnectionFactory - [builtinApplication.queuedAdd_order_add] Passing JDBC URL only to getConnection
                    === 2012-05-22 15:13:51,931 [l0-0] DEBUG PoolableSQLConnectionFactory - [builtinApplication.queuedAdd_order_add] Returning unpooled Connection
                    === 2012-05-22 15:13:51,931 [l0-0] DEBUG SQLTransaction - [builtinApplication.queuedAdd_order_add] Started new HSQLDB transaction "2107180521"
                    === 2012-05-22 15:13:51,931 [l0-0] INFO  SQLDriver - [builtinApplication.queuedAdd_order_add] Executing SQL update on 'HSQLDB': INSERT INTO queuedOrder (customerName, orderDate, orderID) VALUES ('cust3', '2012-05-22 00:00:00', null)
                    === 2012-05-22 15:13:51,934 [l0-0] DEBUG SQLDataSource - [builtinApplication.queuedAdd_order_add] add operation affected 1 rows
                    === 2012-05-22 15:13:51,934 [l0-0] DEBUG HSQLDBDriver - [builtinApplication.queuedAdd_order_add] fetchLastRow data - primaryKeysPresent: {}sequencesNotPresent: [orderID]
                    === 2012-05-22 15:13:51,934 [l0-0] INFO  SQLDriver - [builtinApplication.queuedAdd_order_add] Executing SQL query on 'HSQLDB': CALL IDENTITY()
                    === 2012-05-22 15:13:51,934 [l0-0] INFO  SQLDataSource - [builtinApplication.queuedAdd_order_add] primaryKeys: {orderID=4}
                    === 2012-05-22 15:13:51,934 [l0-0] WARN  DataStructCache - [builtinApplication.queuedAdd_order_add] File queuedAdd_order.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                    === 2012-05-22 15:13:51,935 [l0-0] DEBUG ServerObject - [builtinApplication.queuedAdd_order_add] Couldn't find a public method named: fetch on class: com.smartgwt.sample.server.EmptyClass
                    === 2012-05-22 15:13:51,935 [l0-0] DEBUG DataSourceDMI - [builtinApplication.queuedAdd_order_add] DataSourceDMI: no public method name: fetch available on class: com.smartgwt.sample.server.EmptyClass - defaulting to builtin operations.
                    === 2012-05-22 15:13:51,935 [l0-0] DEBUG AppBase - [builtinApplication.queuedAdd_order_add, builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
                    === 2012-05-22 15:13:51,935 [l0-0] DEBUG AppBase - [builtinApplication.queuedAdd_order_add, builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
                    === 2012-05-22 15:13:51,935 [l0-0] INFO  SQLDataSource - [builtinApplication.queuedAdd_order_add, builtinApplication.null] Performing fetch operation with
                    	criteria: {orderID:4}	values: {orderID:4}
                    === 2012-05-22 15:13:51,936 [l0-0] INFO  SQLDataSource - [builtinApplication.queuedAdd_order_add, builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
                    === 2012-05-22 15:13:51,936 [l0-0] INFO  SQLDataSource - [builtinApplication.queuedAdd_order_add, builtinApplication.null] Executing SQL query on 'HSQLDB': SELECT queuedOrder.customerName, queuedOrder.customerRef, queuedOrder.orderDate, queuedOrder.orderID, queuedOrder.shippingCost FROM queuedOrder WHERE (queuedOrder.orderID='4')
                    === 2012-05-22 15:13:51,936 [l0-0] INFO  SQLDriver - [builtinApplication.queuedAdd_order_add, builtinApplication.null] Executing SQL query on 'HSQLDB': SELECT queuedOrder.customerName, queuedOrder.customerRef, queuedOrder.orderDate, queuedOrder.orderID, queuedOrder.shippingCost FROM queuedOrder WHERE (queuedOrder.orderID='4')
                    === 2012-05-22 15:13:51,937 [l0-0] INFO  DSResponse - [builtinApplication.queuedAdd_order_add, builtinApplication.null] DSResponse: List with 1 items
                    === 2012-05-22 15:13:51,937 [l0-0] INFO  DSResponse - [builtinApplication.queuedAdd_order_add] DSResponse: List with 1 items
                    === 2012-05-22 15:13:51,943 [l0-0] DEBUG AppBase - [builtinApplication.queuedAdd_orderItem_add] No userTypes defined, allowing anyone access to all operations for this application
                    === 2012-05-22 15:13:51,943 [l0-0] DEBUG AppBase - [builtinApplication.queuedAdd_orderItem_add] No public zero-argument method named '_queuedAdd_orderItem_add' found, performing generic datasource operation
                    === 2012-05-22 15:13:51,944 [l0-0] INFO  SQLDataSource - [builtinApplication.queuedAdd_orderItem_add] Performing add operation with
                    	criteria: {quantity:1,categoryName:"Alpha/letter/numeric",itemName:"Label Alpha Sheet Coding Pkt 180 L",orderID:4}	values: {quantity:1,categoryName:"Alpha/letter/numeric",itemName:"Label Alpha Sheet Coding Pkt 180 L",orderID:4}
                    === 2012-05-22 15:13:51,944 [l0-0] INFO  SQLValuesClause - [builtinApplication.queuedAdd_orderItem_add] Ignored data for non-existent or included columns: [categoryName, itemName]
                    === 2012-05-22 15:13:51,944 [l0-0] DEBUG SQLValuesClause - [builtinApplication.queuedAdd_orderItem_add] Sequences: {pk=__default}
                    === 2012-05-22 15:13:51,944 [l0-0] INFO  SQLDriver - [builtinApplication.queuedAdd_orderItem_add] Executing SQL update on 'HSQLDB': INSERT INTO queuedOrderItem (orderID, quantity, pk) VALUES (4, 1, null)
                    === 2012-05-22 15:13:51,945 [l0-0] DEBUG SQLDataSource - [builtinApplication.queuedAdd_orderItem_add] add operation affected 1 rows
                    === 2012-05-22 15:13:51,945 [l0-0] DEBUG HSQLDBDriver - [builtinApplication.queuedAdd_orderItem_add] fetchLastRow data - primaryKeysPresent: {}sequencesNotPresent: [pk]
                    === 2012-05-22 15:13:51,945 [l0-0] INFO  SQLDriver - [builtinApplication.queuedAdd_orderItem_add] Executing SQL query on 'HSQLDB': CALL IDENTITY()
                    === 2012-05-22 15:13:51,945 [l0-0] INFO  SQLDataSource - [builtinApplication.queuedAdd_orderItem_add] primaryKeys: {pk=3}
                    === 2012-05-22 15:13:51,946 [l0-0] WARN  DataStructCache - [builtinApplication.queuedAdd_orderItem_add] File queuedAdd_orderItem.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                    === 2012-05-22 15:13:51,946 [l0-0] DEBUG AppBase - [builtinApplication.queuedAdd_orderItem_add, builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
                    === 2012-05-22 15:13:51,946 [l0-0] DEBUG AppBase - [builtinApplication.queuedAdd_orderItem_add, builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
                    === 2012-05-22 15:13:51,947 [l0-0] INFO  SQLDataSource - [builtinApplication.queuedAdd_orderItem_add, builtinApplication.null] Performing fetch operation with
                    	criteria: {pk:3}	values: {pk:3}
                    === 2012-05-22 15:13:51,947 [l0-0] INFO  SQLDataSource - [builtinApplication.queuedAdd_orderItem_add, builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
                    === 2012-05-22 15:13:51,947 [l0-0] INFO  SQLDataSource - [builtinApplication.queuedAdd_orderItem_add, builtinApplication.null] Executing SQL query on 'HSQLDB': SELECT queuedOrderItem.itemID, queuedOrderItem.orderID, queuedOrderItem.pk, queuedOrderItem.quantity FROM queuedOrderItem WHERE (queuedOrderItem.pk='3')
                    === 2012-05-22 15:13:51,947 [l0-0] INFO  SQLDriver - [builtinApplication.queuedAdd_orderItem_add, builtinApplication.null] Executing SQL query on 'HSQLDB': SELECT queuedOrderItem.itemID, queuedOrderItem.orderID, queuedOrderItem.pk, queuedOrderItem.quantity FROM queuedOrderItem WHERE (queuedOrderItem.pk='3')
                    === 2012-05-22 15:13:51,948 [l0-0] INFO  DSResponse - [builtinApplication.queuedAdd_orderItem_add, builtinApplication.null] DSResponse: List with 1 items
                    === 2012-05-22 15:13:51,948 [l0-0] INFO  DSResponse - [builtinApplication.queuedAdd_orderItem_add] DSResponse: List with 1 items
                    === 2012-05-22 15:13:51,948 [l0-0] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
                    === 2012-05-22 15:13:51,948 [l0-0] DEBUG SQLTransaction - Committing HSQLDB transaction "2107180521"
                    === 2012-05-22 15:13:51,948 [l0-0] WARN  DataStructCache - File queuedAdd_order.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                    === 2012-05-22 15:13:51,949 [l0-0] DEBUG RPCManager - non-DMI response, dropExtraFields: false
                    === 2012-05-22 15:13:51,949 [l0-0] WARN  DataStructCache - File queuedAdd_orderItem.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                    === 2012-05-22 15:13:51,949 [l0-0] DEBUG RPCManager - non-DMI response, dropExtraFields: false
                    === 2012-05-22 15:13:51,950 [l0-0] DEBUG SQLTransaction - Ending HSQLDB transaction "2107180521"
                    === 2012-05-22 15:13:51,954 [l0-0] INFO  Compression - /dsdmi/sc/IDACall: 350 -> 214 bytes
                    Again, thank you for looking into this issue. I am trying to be complete as possible. Let me know any other information you need. I can give you this whole eclipse project if you want.

                    Comment


                      #11
                      Right, you don't need to write server-side Java at all for this use case, and your (broken) DMI declaration is what's causing the issue you're showing with this modified sample.

                      Comment


                        #12
                        Ok, well in that case when I have the serverObject line in the XML commented out and remove the server class why am I getting this error (log 1 from my previous post)

                        Code:
                        === 2012-05-22 15:06:17,019 [0-16] WARN  RequestContext - dsRequest.execute() failed: 
                        java.lang.Exception: Can't find serverObject for operationBinding for DataSource: queuedAdd_order with operationType: addqueuedAdd_order_add - you must define a <serverObject> in the <operationBinding> or provide a default one at the same level as the <operationBindings> declaration.
                        	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:212)
                        	at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:156)
                        	at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:121)
                        	at com.isomorphic.s........
                        edit: This is the exact XML I am using to get this error:

                        Code:
                        <DataSource
                            ID="queuedAdd_order"
                            serverType="sql"
                            tableName="queuedOrder"
                            testFileName="/ds/test_data/queuedOrder.data.xml"
                        >
                            <fields>
                                <field name="orderID" type="sequence" primaryKey="true" hidden="true" />
                                <field name="customerName" type="text" />
                                <field name="customerRef" type="text" />
                                <field name="orderDate" type="date" />
                                <field name="shippingCost" type="float" />
                        	
                        		<field name="quantity" type="integer" tableName="queuedOrderItem"></field>
                        </fields>
                        
                        <!-- <serverObject lookupStyle="new" className="com.smartgwt.sample.server.EmptyClass"/> -->
                        
                        <operationBindings>
                        	<operationBinding operationType="fetch" operationId="customFetch">
                        		<tableClause>queuedOrder, queuedOrderItem</tableClause>
                        		<whereClause>queuedOrder.orderId = queuedOrderItem.orderId AND ($defaultWhereClause)</whereClause>
                        	</operationBinding>
                        	
                        	<operationBinding operationType="add" cacheSyncOperation="customFetch">
                        	</operationBinding>
                        	
                        	
                        </operationBindings>
                        
                        </DataSource>
                        (sorry for not putting this in original post)
                        Last edited by wolf; 22 May 2012, 11:33.

                        Comment


                          #13
                          This is why versions are important :) In older versions of SmartGWT your operationBinding would be (incorrectly) detected as being a no-op, and so the server is trying to let you know the definition is useless. More recent versions correctly notice that a setting for cacheSyncOperation makes this declaration not a no-op.

                          You can avoid this lots of different ways, but one would be to make the DMI declaration valid and just have the Java method "return dsRequest.execute()" (which has no effect on behavior).

                          And just to clarify - all these different ways of having a bad or apparently bad DMI would break the first save operation. At that point it's expected that the subsequent save operations would break since they are trying to refer to the result of the first save operation, which failed.

                          Comment


                            #14
                            Ok thank you for the insight. Just so we are on same page this is the XML I am using and here is the EmptyClass implementing what I hope you mean.

                            Code:
                            <DataSource
                                ID="queuedAdd_order"
                                serverType="sql"
                                tableName="queuedOrder"
                                testFileName="/ds/test_data/queuedOrder.data.xml"
                            >
                                <fields>
                                    <field name="orderID" type="sequence" primaryKey="true" hidden="true" />
                                    <field name="customerName" type="text" />
                                    <field name="customerRef" type="text" />
                                    <field name="orderDate" type="date" />
                                    <field name="shippingCost" type="float" />
                            	
                            		<field name="quantity" type="integer" tableName="queuedOrderItem"></field>
                            </fields>
                            
                            <serverObject lookupStyle="new" className="com.smartgwt.sample.server.EmptyClass"/>
                            
                            <operationBindings>
                            	<operationBinding operationType="fetch" operationId="customFetch">
                            		<tableClause>queuedOrder, queuedOrderItem</tableClause>
                            		<whereClause>queuedOrder.orderId = queuedOrderItem.orderId AND ($defaultWhereClause)</whereClause>
                            	</operationBinding>
                            	
                            	<operationBinding operationType="add" cacheSyncOperation="customFetch">
                            	</operationBinding>
                            	
                            </operationBindings>
                            </DataSource>
                            Code:
                            package com.smartgwt.sample.server;
                            
                            import com.isomorphic.datasource.DSRequest;
                            import com.isomorphic.datasource.DSResponse;
                            
                            public class EmptyClass {
                            	public DSResponse add(DSRequest r) throws Exception {
                            		return r.execute();
                            	}
                            
                            }

                            I am still getting the noodles error. Please let me know if I have followed your instructions correctly.

                            Code:
                            === 2012-05-22 16:08:24,343 [l0-3] INFO  RequestContext - URL: '/dsdmi/sc/IDACall', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2': Moz (Gecko) with Accept-Encoding header
                            === 2012-05-22 16:08:24,345 [l0-3] DEBUG XML - Parsed XML from (in memory stream): 1ms
                            === 2012-05-22 16:08:24,347 [l0-3] DEBUG RPCManager - Processing 2 requests.
                            === 2012-05-22 16:08:24,347 [l0-3] WARN  DataStructCache - File queuedAdd_order.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                            === 2012-05-22 16:08:24,348 [l0-3] DEBUG RPCManager - Request #1 (DSRequest) payload: {
                                values:{
                                    orderDate:new Date(1337659200000),
                                    customerName:"cust1"
                                },
                                operationConfig:{
                                    dataSource:"queuedAdd_order",
                                    operationType:"add"
                                },
                                componentId:"isc_DynamicForm_0",
                                appID:"builtinApplication",
                                operation:"queuedAdd_order_add",
                                oldValues:{
                                },
                                criteria:{
                                }
                            }
                            === 2012-05-22 16:08:24,349 [l0-3] WARN  DataStructCache - File queuedAdd_orderItem.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                            === 2012-05-22 16:08:24,349 [l0-3] DEBUG RPCManager - Request #2 (DSRequest) payload: {
                                values:{
                                    quantity:1,
                                    categoryName:"Accessories",
                                    itemName:"Magnetic Letters Quartet 25mm (1)"
                                },
                                operationConfig:{
                                    dataSource:"queuedAdd_orderItem",
                                    operationType:"add"
                                },
                                componentId:"isc_ListGrid_1",
                                appID:"builtinApplication",
                                operation:"queuedAdd_orderItem_add",
                                oldValues:{
                                    quantity:1,
                                    categoryName:"Accessories",
                                    itemName:"Magnetic Letters Quartet 25mm (1)"
                                },
                                criteria:{
                                }
                            }
                            === 2012-05-22 16:08:24,350 [l0-3] INFO  IDACall - Performing 2 operation(s)
                            === 2012-05-22 16:08:24,351 [l0-3] DEBUG AppBase - [builtinApplication.queuedAdd_order_add] No userTypes defined, allowing anyone access to all operations for this application
                            === 2012-05-22 16:08:24,351 [l0-3] DEBUG AppBase - [builtinApplication.queuedAdd_order_add] No public zero-argument method named '_queuedAdd_order_add' found, performing generic datasource operation
                            === 2012-05-22 16:08:24,351 [l0-3] INFO  SQLDataSource - [builtinApplication.queuedAdd_order_add] Performing add operation with
                            	criteria: {orderDate:new Date(1337659200000),customerName:"cust1"}	values: {orderDate:new Date(1337659200000),customerName:"cust1"}
                            === 2012-05-22 16:08:24,353 [l0-3] DEBUG SQLValuesClause - [builtinApplication.queuedAdd_order_add] Sequences: {orderID=__default}
                            === 2012-05-22 16:08:24,356 [l0-3] DEBUG PoolableSQLConnectionFactory - [builtinApplication.queuedAdd_order_add] DriverManager fetching connection for HSQLDB via jdbc url jdbc:hsqldb:hsql://localhost/isomorphic
                            === 2012-05-22 16:08:24,356 [l0-3] DEBUG PoolableSQLConnectionFactory - [builtinApplication.queuedAdd_order_add] Passing JDBC URL only to getConnection
                            === 2012-05-22 16:08:24,357 [l0-3] DEBUG PoolableSQLConnectionFactory - [builtinApplication.queuedAdd_order_add] Returning unpooled Connection
                            === 2012-05-22 16:08:24,357 [l0-3] DEBUG SQLTransaction - [builtinApplication.queuedAdd_order_add] Started new HSQLDB transaction "931550882"
                            === 2012-05-22 16:08:24,357 [l0-3] INFO  SQLDriver - [builtinApplication.queuedAdd_order_add] Executing SQL update on 'HSQLDB': INSERT INTO queuedOrder (customerName, orderDate, orderID) VALUES ('cust1', '2012-05-22 00:00:00', null)
                            === 2012-05-22 16:08:24,361 [l0-3] DEBUG SQLDataSource - [builtinApplication.queuedAdd_order_add] add operation affected 1 rows
                            === 2012-05-22 16:08:24,362 [l0-3] DEBUG HSQLDBDriver - [builtinApplication.queuedAdd_order_add] fetchLastRow data - primaryKeysPresent: {}sequencesNotPresent: [orderID]
                            === 2012-05-22 16:08:24,362 [l0-3] INFO  SQLDriver - [builtinApplication.queuedAdd_order_add] Executing SQL query on 'HSQLDB': CALL IDENTITY()
                            === 2012-05-22 16:08:24,362 [l0-3] INFO  SQLDataSource - [builtinApplication.queuedAdd_order_add] primaryKeys: {orderID=7}
                            === 2012-05-22 16:08:24,362 [l0-3] INFO  SQLDataSource - [builtinApplication.queuedAdd_order_add] HSQLDB getLastRow(): using specific cacheSyncOperation customFetch
                            === 2012-05-22 16:08:24,362 [l0-3] WARN  DataStructCache - [builtinApplication.queuedAdd_order_add] File queuedAdd_order.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                            === 2012-05-22 16:08:24,363 [l0-3] DEBUG ServerObject - [builtinApplication.queuedAdd_order_add] Couldn't find a public method named: fetch on class: com.smartgwt.sample.server.EmptyClass
                            === 2012-05-22 16:08:24,365 [l0-3] DEBUG DataSourceDMI - [builtinApplication.queuedAdd_order_add] DataSourceDMI: no public method name: fetch available on class: com.smartgwt.sample.server.EmptyClass - defaulting to builtin operations.
                            === 2012-05-22 16:08:24,365 [l0-3] DEBUG AppBase - [builtinApplication.queuedAdd_order_add, builtinApplication.customFetch] No userTypes defined, allowing anyone access to all operations for this application
                            === 2012-05-22 16:08:24,366 [l0-3] DEBUG AppBase - [builtinApplication.queuedAdd_order_add, builtinApplication.customFetch] No public zero-argument method named '_customFetch' found, performing generic datasource operation
                            === 2012-05-22 16:08:24,366 [l0-3] INFO  SQLDataSource - [builtinApplication.queuedAdd_order_add, builtinApplication.customFetch] Performing fetch operation with
                            	criteria: {orderID:7}	values: {orderID:7}
                            === 2012-05-22 16:08:24,366 [l0-3] INFO  SQLDataSource - [builtinApplication.queuedAdd_order_add, builtinApplication.customFetch] derived query: SELECT $defaultSelectClause FROM queuedOrder, queuedOrderItem WHERE queuedOrder.orderId = queuedOrderItem.orderId AND ($defaultWhereClause)
                            === 2012-05-22 16:08:24,367 [l0-3] INFO  SQLDataSource - [builtinApplication.queuedAdd_order_add, builtinApplication.customFetch] Executing SQL query on 'HSQLDB': SELECT queuedOrder.customerName, queuedOrder.customerRef, queuedOrder.orderDate, queuedOrder.orderID, queuedOrderItem.quantity, queuedOrder.shippingCost FROM queuedOrder, queuedOrderItem WHERE queuedOrder.orderId = queuedOrderItem.orderId AND ((queuedOrder.orderID='7'))
                            === 2012-05-22 16:08:24,367 [l0-3] INFO  SQLDriver - [builtinApplication.queuedAdd_order_add, builtinApplication.customFetch] Executing SQL query on 'HSQLDB': SELECT queuedOrder.customerName, queuedOrder.customerRef, queuedOrder.orderDate, queuedOrder.orderID, queuedOrderItem.quantity, queuedOrder.shippingCost FROM queuedOrder, queuedOrderItem WHERE queuedOrder.orderId = queuedOrderItem.orderId AND ((queuedOrder.orderID='7'))
                            === 2012-05-22 16:08:24,367 [l0-3] INFO  DSResponse - [builtinApplication.queuedAdd_order_add, builtinApplication.customFetch] DSResponse: List with 0 items
                            === 2012-05-22 16:08:24,368 [l0-3] INFO  DSResponse - [builtinApplication.queuedAdd_order_add] DSResponse: List with 0 items
                            === 2012-05-22 16:08:24,377 [l0-3] WARN  RequestContext - dsRequest.execute() failed: 
                            org.apache.velocity.exception.MethodInvocationException: Invocation of method 'last' in  class com.isomorphic.velocity.ResponseDataHandler threw exception java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at notProvided[line 1, column 15]
                            	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:212)
                            	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)
                            Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
                            	at java.util.ArrayList.RangeCheck(Unknown Source)
                            	at java.util.ArrayList.get(Unknown Source)
                            	at com.isomorphic.rpc.RPCManager.findResponseData(RPCManager.java:2301)
                            	at com.isomorphic.velocity.ResponseDataHandler.last(ResponseDataHandler.java:111)
                            	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                            	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                            	at java.lang.reflect.Method.invoke(Unknown Source)
                            	at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
                            	at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
                            	at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
                            	at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:252)
                            	at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:332)
                            	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
                            	at org.apache.velocity.runtime.RuntimeInstance.render(RuntimeInstance.java:1277)
                            	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1216)
                            	at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1165)
                            	at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:219)
                            	at com.isomorphic.velocity.Velocity.evaluate(Velocity.java:210)
                            	at com.isomorphic.velocity.Velocity.evaluate(Velocity.java:157)
                            	at com.isomorphic.rpc.RPCManager.applyEarlierResponseValues(RPCManager.java:2216)
                            	at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1915)
                            	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:199)
                            	... 26 more
                            === 2012-05-22 16:08:24,377 [l0-3] WARN  DataStructCache - File queuedAdd_orderItem.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                            === 2012-05-22 16:08:24,378 [l0-3] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
                            === 2012-05-22 16:08:24,378 [l0-3] DEBUG SQLTransaction - Rolling back HSQLDB transaction "931550882"
                            === 2012-05-22 16:08:24,378 [l0-3] WARN  DataStructCache - File queuedAdd_order.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                            === 2012-05-22 16:08:24,379 [l0-3] DEBUG RPCManager - DMI response, dropExtraFields: true
                            === 2012-05-22 16:08:24,379 [l0-3] WARN  DataStructCache - File queuedAdd_orderItem.ds not found at explicitly specified location C:/Users/wolf/smartgwtee-3.0p/samples/ds-dmi/war/dsdmi/sc/system/reference/inlineExamples/serverExamples/sql/queuedAdd, checking project-wide area
                            === 2012-05-22 16:08:24,380 [l0-3] DEBUG RPCManager - non-DMI response, dropExtraFields: false
                            === 2012-05-22 16:08:24,380 [l0-3] DEBUG SQLTransaction - Ending HSQLDB transaction "931550882"
                            === 2012-05-22 16:08:24,381 [l0-3] INFO  Compression - /dsdmi/sc/IDACall: 403 -> 267 bytes

                            Comment


                              #15
                              This log shows a SQL query executing to fetch the order that was just added, the SQL is correct (it's where clause selects to the just-added order), but it inexplicably fails.

                              Not sure why you're holding back version information, but again, be sure to test with the latest patched version.

                              Comment

                              Working...
                              X