Suggestion on using SwingThreads to fetch data with Stateless Sessin Beans

Hi,
I have developed a GUI application using Swing.
Using this GUI user will be able to view data (Tabular representation)fetched from database using Stateless session beans. In the application there will be two tabs and data should be fetched based on filtering parameters like Id which is a combo box. So if the user changes the comboBox selection, the data should be updated in two tabs irrespective of current tab focus.
Currently I'have not used any Threading concept while fetching data. I have made calls based on Tab focus. But plans to use SwingThread SwingUtilities class. But it has problems of asychronous communication. So if anyone has faced problems using swing thread for doing database access using stateless session beans can throw somelight on this to avoid problems which may come later.
In simpler terms using Swing threads have to make two or three EJB calls and fetch data from database and update the Table data.
Thanks.

Your user response time should not necessarily increase. You could load your data for the selected tab first and update the display after each response. This is simply showing information as soon as it becomes available rather than waiting for the entire operation (2 remote calls) to complete.
If you use 2 Threads you might get this anyway but should ensure that your EJB calls happen in parallel otherwise you should work out the best order for them yourself.
I'm not sure I'd say that you'd get synchronisation issues. You might get data issues whereby, as you rightly say, one of your calls returns an error. This shouldn't cause too many problems but you will need to make sure you've got suitable error-handling code and the ability to convey errors to the user.
Personally, if the calls were dependent on each other I'd make them one after another in the same Thread rather than trying to coordinate two concurrent remote calls.
If you're worried about the overhead of two remote calls in series then you can always expose another stateless session bean method that will perform both calls (or however many you want) for you in one remote call, thereby cutting down the overhead and simplifying your client development.
Hope this helps.

Similar Messages

  • Unable to fetch Data with apps_query_role

    Hi Guru,
    There is some issue on fetching data with my database account i have apps_query_role i can fect the data from devlopemnet instance.
    which checked in devlopemnt instance:
    select * from all_directories
    I am getting data
    When doing same thing in prod i am getting no row selected. Please help here.

    Hi,
    it would be hard to guess the things.. Try to check the session_privs from your current session with prod,
    Try to check privs granted on directories to specific to your account or not.
    - Pavan Kumar N

  • How to Use SOAPArray to Exchanged Data with a Web Service

    The method of a prototype Web service I created is defined to take many parameters
    and return an object of a user defined class. Furthermore, the user defined class
    includes data elements of another user defined class and the Java ArrayList class.
    This works with a Java client referencing the WebLogic created client.jar file
    but I don't know how well it will work with a non-Java client. In particular,
    with Perl which is the language that will be used by the developer who first will
    test with the prototype.
    In posts to this newsgroup use of "language-specific, generic containers" has
    been discouraged and the "language-agnostic" SOAPArray recommended. I have searched
    this newgsroup and the Web for examples of how to use a SOAPArray in a Web service
    EJB to receive parameters and return results but found none.
    Will someone refer me to an example or give an overview of how a Java Web service
    EJB running in WebLogic 6.1 would use SOAPArray to get parameter values and return
    results?
    Also, I would like confirmation that it is best to use SOAPArray to exchange data
    with a Web service to achieve the goal of a service accessible by any language.
    Thank you.

    Replies in-line:
    How are the structures, e.g. gltrans-workType, defined in the Web service?The structure is made up of nested Java Beans, but this does not mean that the
    client for your web service has to be written in Java. The WSDL that I sent contains
    everything that a .NET-based (or Perl-based, or Python-based, or VB-based, or
    C++ based) Web Service Stack needs to correctly create all the data types in the
    web services' signature! That's the beauty of XML Schema! It's programming language
    independent :-)
    In
    other words, what definition in Java resulted in the WSDL statements?The WSDL wasn't produced by WLS 6.1, but it (WLS 6.1) can consume it.
    What is the signature of method submitGLTransWorkAsJavaBean() in the
    Web service?public void submitGLTransWorkAsJavaBean(GlTransactionsCpyType glTransactionsCpyType)
    GlTransactionsCpyType is the outer-most Java Bean. WLS 6.1 does not generate
    Java Beans for you, but it will use ones that you defined. See the Java Bean tutorial
    on the Javasoft sitem for details on how to create a Java Bean.
    Was the WSDL generated using the WL tools for creating a Web service?No.
    Conclusion:
    You asked for someone to provide you with an example of how to use SOAP array
    in a WSDL, which is what the attached file contained :-) What you want to do now
    is find a tool that can generate Java Bean code from this WSDL (Apache Axis has
    a wsdl2java tool that should work), or create the Java Beans yourself. Afterwards,
    create a WLS 6.1 Web Service a expose it for a Perl or .NET client.
    Regards,
    Mike Wooten
    "Jeff Carey" <[email protected]> wrote:
    >
    Please elaborate.
    How are the structures, e.g. gltrans-workType, defined in the Web service?
    In
    other words, what definition in Java resulted in the WSDL statements?
    What is the signature of method submitGLTransWorkAsJavaBean() in the
    Web service?
    Was the WSDL generated using the WL tools for creating a Web service?
    Thank you.
    "Michael Wooten" <[email protected]> wrote:
    Hi Jeff,
    Sounds like a pretty cool prototype :-)
    I have attached a WSDL (at the bottom of this post) that contains a<schema>
    that
    uses a SOAPArray to create an array of a <complexType>.
    HTH,
    Mike Wooten
    "Jeff Carey" <[email protected]> wrote:
    The method of a prototype Web service I created is defined to take
    many
    parameters
    and return an object of a user defined class. Furthermore, the user
    defined class
    includes data elements of another user defined class and the Java ArrayList
    class.
    This works with a Java client referencing the WebLogic created client.jar
    file
    but I don't know how well it will work with a non-Java client. Inparticular,
    with Perl which is the language that will be used by the developerwho
    first will
    test with the prototype.
    In posts to this newsgroup use of "language-specific, generic containers"
    has
    been discouraged and the "language-agnostic" SOAPArray recommended.
    I have searched
    this newgsroup and the Web for examples of how to use a SOAPArray in
    a Web service
    EJB to receive parameters and return results but found none.
    Will someone refer me to an example or give an overview of how a Java
    Web service
    EJB running in WebLogic 6.1 would use SOAPArray to get parameter values
    and return
    results?
    Also, I would like confirmation that it is best to use SOAPArray toexchange
    data
    with a Web service to achieve the goal of a service accessible by any
    language.
    Thank you.

  • Using Query to fetch data from xml file

    Hi guys ,
    Just want to know , how to fetch data from an XML file in adobe flex? i have a database generated xml file.

    you can use httpService.

  • Any sample program to fetch data with JSP from MySQL

    Hi,
    Anybody can you ple give me a sample code to fetch data from MySQL and show it.
    Database server : localhost
    Databasename : test
    Database User : root
    Database Password : (database have no password)
    Table Name : category
    Table column name : catName
    I am trying the following code, but it gives error:
    exception
    org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    <%@ page import="java.sql.*" %>
    <%
    String connectionURL = "jdbc:mysql://localhost:3306/test";
    Connection connection = null;
    Statement statement = null;
    ResultSet rs = null;
    %>
    <html><body>
    <%
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    connection = DriverManager.getConnection(connectionURL, "root", "");
    statement = connection.createStatement();
    rs = statement.executeQuery("SELECT * FROM category");
    while (rs.next()) {
    out.println(rs.getString("catName")+"<br>");
    rs.close();
    %>
    </body></html>
    any help is appreciated.
    ---Sujoy

    Just replace the following code. I think it will work for u.
    <%@ page import="java.sql.*" %>
    <%
    try{
    String connectionURL = "jdbc:mysql://localhost:3306/test";
    Connection connection = null;
    Statement statement = null;
    ResultSet rs = null;
    Class.forName("com.mysql.jdbc.Driver");
    connection = DriverManager.getConnection(connectionURL, "root", "");
    statement = connection.createStatement();
    rs = statement.executeQuery("SELECT * FROM category");
    %>
    <html><body>
    <table>
    <%
    while(rs.next())
    %>
    <tr><td><%=rs.getString("catName")%></td></tr>
    <%
    %>
    </table>
    </body>
    </html>
    <%
    rs.close();
    statement.close();
    connection.close();
    catch(Exception e)
           e.printStackTrace();
    finally()
      try{
       rs.close();
       statement.close();
       connection.close();
      catch(Exception e)
            e.printStackTrace();
    %>

  • TX isolation level with stateless session bean in oc4j

    Hi All,
    I have a stateless session bean with container managed transaction method. This method is called in a Servlet. This method retrieves data from database using 'ejb-location'connection pool and closes the connection inside. Max-connection setting for connection pool is 50
    I am facing a problem running servlet multiple times.
    When i have the tx_attribute as Supports, it works fine. I can run the servlet hundreds of times
    But when i have the tx_attribute as Required, i am able to run servlet only 50 times and further it says 'Max connection limit exceed..unable to get the connection'.
    I assume that with 'Required' attribute, it starts a transaction. Why is the transaction not getting completed at end of method? Is transaction hanging somewhere?
    I assume that i am closing the connection properly as it is working fine with supports attribute.
    When i monitor database, there are only 20 connections.
    Why am i seeing this behaviour?
    Thanks
    srinath

    Hi Deepak,
    Thanks for your reply.
    Actually, our stand alone java application already using spring-hibernate feature. Now we are planning divide our application into modules and deploy each module as ejb beans. As it is already integrated with spring-hibernate we are not using entity beans as of now. My understanding is container uses some default transcation management .so, my question is what are all the configurations needs to be done to let weblogic 10.0 server uses org.springframework.orm.hibernate3.HibernateTransactionManager. I mean, is there are any .xml file in weblogic to configure all these? please reply deepak I am struck here..
    Regards,
    Rushi.

  • How to integrate hibernate with Stateless Session bean in weblogic10.0

    Hi,
    I need to invoke hibernate(3.x) DAO from EJB Stateless Session bean(EJB2.x). I am using mysql database. Can somebody please post the configuration.
    Thanks in advance,
    Rushi.

    Hi Deepak,
    Thanks for your reply.
    Actually, our stand alone java application already using spring-hibernate feature. Now we are planning divide our application into modules and deploy each module as ejb beans. As it is already integrated with spring-hibernate we are not using entity beans as of now. My understanding is container uses some default transcation management .so, my question is what are all the configurations needs to be done to let weblogic 10.0 server uses org.springframework.orm.hibernate3.HibernateTransactionManager. I mean, is there are any .xml file in weblogic to configure all these? please reply deepak I am struck here..
    Regards,
    Rushi.

  • Implementing Web Service with Stateless Session Bean

    I have a web service that I've built using the WorkSpace Studio tools (create a WSDL, generate the Java code from the WSDL, fill in the skeleton methods in the service implementation class). This service is deployed as a web module within an EAR to WebLogic Server 10.0 and is working great as a web service.
    I'd like to be able to also call the operations on this service via an EJB interface (from a different application on the same server). I followed the guidelines for adding EJB annotations to the web service implementation class (from [http://edocs.bea.com/wls/docs100/webserv/jws.html#wp215790]). I added the @Session annotation to the class, implemented javax.ejb.SessionBean, and added the ejbXXX() methods. This all makes perfect sense, and looked like it was going to work. However, WorkSpace Studio now gives me a compile error on the class that says "EJB backed WebServices are not supported."
    A few internet searches for that error didn't return anything relevant.
    It seems like I followed the instructions correctly. Is there a better way to build a service like this that is both a web service endpoint and a stateless session bean?
    Thanks!
    -Eric

    Having separate EJB and web modules certainly makes things easier, but I have non-trivial (i.e. not feasible to copy) application logic that I'd like to expose with both a bean interface (for intra-application usage) and a web service interface (for public consumption).
    I've tried starting with a "web application" WorkSpace Studio project and adding bean annotations. This produces the error I originally described. I also tried starting with an "EJB" WorkSpace Studio project and adding web service annotations. This fails at deployment time with errors about missing web service descriptors (the error is correct - the web-service-related descriptor elements are missing from the deployment descriptors).
    The documentation explicitly presents this as an option (annotating a class with both web service and session bean annotations), but how does one actually make this work?

  • Use APD to fetch data from Query's Structure

    Hi,
    i have created a query , with a fixed structure in the Row area and two keyfigures.
    I have this query on DSO.
    i want to store the same query output to one table. 
    How can i achive this?
    I think to use the APD, but as i have fix structure in query , APD is not the solution . correct me if i am worng.
    Please suggest.
    Regards,
    Macwan James.

    Hi SVU123,
    Currently I am trying to load data into ODS only. But I want to avoid this path. I can always extract data out of the ODS to Flat File through Open Hub, but that will require twice the time to extract data.
    First from Query to ODS and second from ODS to Flat File through open hub.
    Basically, I want to automate this process and that is why I don't want to opt the path for RSCRM_BAPI t-code.
    - Danny

  • Using Contractor to exchange data with P6 users

    Contractor allows you to exchange project files with
    Primavera P6. Have you tried to exchange project
    information with P6 users? What data is most important to
    you in this transfer process?

    Hi,
    >>This VMI implementation using APO ( that is Customer system -> APO(DP/SNP)-> ECC6 (Sales order)), Customer will be sending sales and stock data to APO and we may have to send confirmation after Sales order create in ECC6.
    in terms of VMI your customer does not need to have SAP
    there are standard EDI VMI  messages likes orders/ ordersp/invrep
    which can be used in all VMI scenarios in SAP and in non SAP env.
    so in terms of multiple customers you should be using what your GS1 org or similar is proposing
    in your country - so you can add other clients in the same way
    if you use an EDI broker they usually have a predefined standard (EDI or XML)
    which can be easily used
    Regards,
    Michal KRawczyk

  • Fetching Data with dates

    Hi Experts,
    I am having this scenario.
    PERNR          BEGDA          ENDDA
    000001          01.01.2006     13.01.2007
    000001          14.01.2007     31.12.9999
    000002          14.01.1982     12.11.2006
    000002          13.11.2006     31.01.2007
    000002          01.02.2007     31.12.9999
    This is the scenario my requirement is like that if I will enter PERNR = 1 then it will display 14.01.2007 record. And if I will enter PERNR = 2 then it will display 13.11.2006.
    Regards,
    Rajneesh Gupta

    i don know why u r such awkward requirements.but instead of going for simple HR,u shud go for ABAP-Hr and then write ur code.use LDB PNP.
    and use Get pernr event and then move ur concerned data to ur output internal table.
    Get pernr event will fetch all the Infotype records for the concerned pernr and then u can have particular one in ur iutput table as per ur requirement.
    demo code for using LDBs -
    tables: pernr.
    infotypes: 0021.
    *eject
    *& Constants                                                           *
    constants: c_1(1)       type c               value '1' .
    data: begin of t_output occurs 0,
           num_dep(2) type n,
           pernr like pernr-pernr.
    data: end of t_output.
    data: count type i.
    *eject
    *& Initialization                                                      *
    Initialization.
    Initialize Selection-Screen values
    perform init_selction_screen.
    Start-of-selection.
    get pernr.
      clear t_output.
    Read Infotype 0021
      rp-provide-from-last p0021 space pn-begda pn-endda.
      check pnp-sw-found eq c_1.
    Gather all the required information related to the emp
      describe table p0021 lines count.
      move: pernr-pernr to t_output-pernr,
            count to t_output-num_dep.
      append t_output.
      Clear count.
    *eject
    *& End-of Selection                                                    *
    end-of-selection.
      perform print_report.
    *eject
    *&      Form  print_report
    *Description:
    FORM print_report .
    Print the report
      loop at t_output.
      skip 1.
      at sum
      write: 2 t_output-pernr,
             15 t_output-num_dep.
      endloop.
    ENDFORM.                    " print_report

  • Why does my iphone use hugh amounts of data with no apps running?

    5 days ago my data usage went from 15 meg/day to 150-200.  I have tried shutting off all app that were running and Ihave power off the phone.

    Hi terrymaclean,
    If you are concerned about the amount of data your phone is using, here are some tips that can help reduce that:
    iOS: About cellular data usage
    http://support.apple.com/kb/HT4146
    Cheers,
    - Ari

  • Help! using FM for formating date with to_char()

    Hi,
    Basically my requirement is to format the date in specific format (i.e. DD MM YYYY HH24:MM) and it should avoid the padding zeros.
    Ex: 03-Jun-2009 10:01 should be displayed as 3 Jun 2009 10:01.
    I was using the below query
    to_char(sr.recievedat, 'FMDD Mon yyyy HH24:MI')...
    But the thing is it removing the padding zeros from minuites aswell, which i dont require.
    For example,
    Ex1: 03-Dec-2009 18:10    3 Dec 2009 18:10
    *04-Dec-2009 19:01 4 Dec 2009 19:1.. It should be 4 Dec 2009 19:01*
    Can some body help me how to control the FM to restrict the padding to some places
    Thanks
    Phani

    Hi try this
    sql> select to_char(sr.recievedat, 'FMDD Mon yyyy fmHH24:MI') from dual;example
    SQL> select to_char(to_date('01-jan-2009 7:01:06','dd-mon-rrrr HH:MI:SS'), 'FMDD Mon yyyy fmHH24:MI'
    ) from dual;
    TO_CHAR(TO_DATE('01-JAN
    1 Jan 2009 07:01

  • How to use "GET" to fetch data and insert it in Edge?

    I have a compostion in which I need to insert a name  with "GET". How can I do that. This is new territory to me,

    Json data type would be an ideal option.
    jquery reference - http://api.jquery.com/jQuery.getJSON/
    Nice example here rom gotoandlearn - http://www.gotoandlearn.com/play.php?id=168
    Darrell

  • •If you are using FormsCentral to collect data with PDF forms, consider downloading the form and using Adobe Acrobat software to distribute and track responses. Learn how to re-purpose your form.  Ok, How?

    Once Formscentral is done, how can I continue to use my forms as a PDF file? Will my customer still just be able to hit submit and have the form come to me? What can I maintain from the original format?

    Hi SEJA,
    I believe the following Detailed FAQ document will answer all your questions regarding FormsCentral: Retirement . Please check it out.
    In case you still have a doubt, feel free to reply back.
    Regards,
    Rahul

Maybe you are looking for