Announcement

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

    DataSource usage

    I have basic doubts regarding usage of DataSource configuration in xml files.

    I created a datasource for a table with multiple operation bindings. These multiple operation bindings help me to group data at different levels.

    For a search criteria user enters I need to generate a ListGrid data and a graph.
    ListGrid need to use Paging since data could be huge in most cases and is grouped on multiple columns. But Graph data need to be complete and is grouped on one particular column,so that graph provides whole picture of the data. So i'm using FetchMode.Basic for graph.

    Since FacetChart doesn't support setFacets() in 2.4, i'm trying to actually generate a list grid with data required for the graph , make in invisible and then invoke chartData to generate the graph.

    Hence i end up using the same datasource but different operation bindings for listgrid of report and listgrid of graph. But the problem i have is the search criteria is shown as null in case of graph query generation in the log below.

    Code:
    2011-04-08 00:29:36,786 [or23] INFO  SQLDriver - [builtinApplication.graphReport] Execute of select: SELECT 
                    domairl,sum(pax_count) as  bookings
                 FROM adb WHERE 
                    security_id in ($criteria.security_id)  and dates between $criteria.fromDate and $criteria.toDate and
                     WACO  in
                                      ) and
                      WACD  in
                                      )
                 GROUP BY 
                    domairl
                 on db: jdbc/mdads threw exception: java.sql.SQLException: ORA-00911: invalid character
     - assuming stale connection and retrying query.
    === 2011-04-08 00:29:42,817 [or25] DEBUG PoolableSQLConnectionFactory - [builtinApplication.summaryReport] Returning unpooled Connection
    === 2011-04-08 00:29:42,817 [or25] INFO  SQLDriver - [builtinApplication.summaryReport] Executing SQL query on 'jdbc/mdads': SELECT COUNT(*) FROM (SELECT 
                    orig,ORG_CTY_CD,ORG_CNTRY_CD,WACO,dest, DEST_CTY_CD,DEST_CNTRY_CD,WACD,opairl,domairl, sum(upax) as UnadjBookings, sum(pax_count) as bookings,round(sum(adb_revenue)/sum(pax_count),2) as fare, sum(adb_revenue) as revenue
                 FROM adb WHERE 
                    security_id in ('120')  and dates between 200901 and 200901 and
                     ORIG  in
                                                         (   'BOM'
                      ) and
                      DEST  in
                                                         (   'DEL'
                      )
                 GROUP BY 
                    orig,ORG_CTY_CD,ORG_CNTRY_CD,WACO,dest, DEST_CTY_CD,DEST_CNTRY_CD,WACD,opairl,domairl
                ) work
    === 2011-04-08 00:29:43,145 [or23] DEBUG PoolableSQLConnectionFactory - [builtinApplication.graphReport] Returning unpooled Connection
    === 2011-04-08 00:29:44,786 [or23] WARN  RequestContext - dsRequest.execute() failed: 
    java.sql.SQLException: ORA-00911: invalid character
    
    	at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    	at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
    	at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
    	at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
    	at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:830)
    So i would like to know if datasource can be used by only one connection at a time and all other requests while a datasource is processing a query will not get the search criteria.

    Thanks.

    #2
    No need to do this extra wrangling - grab a nightly from smartclient.com/builds and you'll find that FacetChart has setFacets() (and there are more samples now).

    As far as ending with null criteria, it's not clear how this happens (you didn't show code), but it trivial to call DataSource.fetchData() using the same criteria currently being used in a ListGrid, since there's a getCriteria() API.

    Comment


      #3
      i just checked the samples.

      All of the charts use SampleChartData.getData() to set the data for the chart.
      Can you provide a snippet of how to get data from a datasource configure in xml file using operation binding and then setting it to chart.

      Thanks.

      Comment


        #4
        That's really straightforward and you should be able to do it without needing a sample to follow - just call setData() from the DSCallback of DataSource.fetchData() - but if you really need a sample, there is one that's just been added today and will appear in the next nightly.

        Comment


          #5
          Thanks a lot,, You rock...!

          By the way for a chart data can we not use operation Binding ? I dont see a setFetchOpertaion() method in DataSource class.

          Comment


            #6
            When calling DataSource.fetchData() directly, use dsRequest.setOperationId() to specify which operationBinding to use.

            Comment

            Working...
            X