Announcement

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

    bind Smart GWT 2.5/2.4 DataSource using RequestFactory servlet

    I started to create an app using GWT 2.3 and then incorporated widgets from Smart GWT 2.4 but just upgraded to 2.5 today. My app is using the RequestFactory servlet along with MyBatis for basic CRUD operations. Upon further reading, it appears that using a DataSource with my DynamicForm will be more efficient. When looking at the examples (builtInDS) in the 2.5 download, RPC is being used as opposed to RequestFactory. Without diving any deeper, does anyone know if it is possible to use the Smart GWT DataSource with the RequestFactory?

    #2
    You may have seen the term "RPC" or "RPCManager" in SmartGWT docs, but this is not GWT-RPC but something better in several ways (no DTOs, simpler, lots of useful server behaviors, also provides automatic access via REST, etc). See the QuickStart Guide for an overview.

    Comment


      #3
      So I got things working using the evaluation version (smartgwtee-2.5) and Oracle 11g after reviewing the "quick guide" and a few other posts w/in the forum. I am now trying to call a stored proc. that I wrote that returns an OUT param of sys_refcursor.

      the sp is as follows:

      PROCEDURE Get...(prc OUT sys_refcursor)
      AS
      BEGIN
      OPEN prc FOR SELECT...
      END;

      This is how I have the call set up in the ...ds.xml file:

      <DataSource ID="employees" serverType="sql" tableName="EMP">
      <operationBinding operationType="fetch">
      <customSQL>call getemployees()</customSQL>
      </operationBinding>
      </DataSource>

      Is this possible with the DataSource? Do I need to change how the stored proc is constructed?

      Comment


        #4
        Looks like you need to include or wrap <operationBindings> around <operationBinding>. The stored proc is now being called, but now need to figure out how to handle output param for the stored proc.

        Comment


          #5
          You beat us to it on the missing <operationBindings> tag..

          On what to return, it should work to return a rowset from the stored procedure, although we have in the past seen Oracle being a bit strange about this (differences across minor versions). Let us know if you run into trouble.

          Comment


            #6
            So the problem that I am encountering now is how to handle the OUT parameter that I need to pass into the SP call. When the following is executed, Oracle obviously complains about the wrong number of args in the call to the SP.

            <customSQL>
            call getemployees()
            </customSQL>

            I see the example in the guide for a remove operation, but how do I handle specifying an OUT param? In SQL Server, one would not have to worry about specifying an OUT param since you can simple say "SELECT * FROM..." as the return type. Is the thought here that I need to re-write the SP to not take an OUT param? Maybe change to a function which is possible.
            Last edited by mikeswong; 10 Aug 2011, 18:40.

            Comment


              #7
              Yes, the super-simple approach of just dropping SQL into a customSQL block requires that the SQL return the value that is supposed to go back to the client. Otherwise we'd need a bunch more declarations to understand which OUT param is intended to be the result and how to get data out of it.

              If you can either switch to a function or wrap the procedure with a function this should work.

              Comment


                #8
                Hi mikeswong,

                did you ever solve your problem? I have a similar one in this thread.

                Thank you & Best regards
                Blama

                Comment

                Working...
                X