Discussions

EJB design: Very seriuos performance problems

  1. Very seriuos performance problems (2 messages)

    Hi all,
    I have very serious problems of performance
    in the following scenario:

    Client -> Business Delegate -> Stateless Session Bean -> DAO -> DB

    Session Beans are insides a JBoss Application Server.
    JBoss is running on a i386/Linux machine with only
    256 Mb of Ram.

    When the client ask a large amount of data JBoss
    isn't able to answer and I get, server side, an
    OutOfMemory Exception.

    I tried to run JBoss with -Xms and -Xmx options
    but situation changes only a little.

    The same problem happens client-side because
    my client has got only 64 or 128 Mb of Ram.

    In this moment I retrieve all data in a big Vector
    of serialized objects.

    The question is:

    Do I need to split my select in N selects, retrieving
    data in blocks ? (I'm afraid about increasing the number of remote call from client to server (now I have only
    one remote call)

    Isn't there any other (not hardware) solution ?


    Many thanks in advance,
    Moreno
  2. Paginate/Limit your Result Set[ Go to top ]

    Do you really need all that data in the client in one go? Why dont you limit the result set at the JDBC level using PreparedStatement::setMaxRows()

    To fetch more data just keep track of what row your up to and re-issue the select from that row foward.
  3. Paginate/Limit your Result Set[ Go to top ]

    I'll follow your suggest:
    from one BIG select to N little selects
    (I'll try to find the right compromise between
    data dimension and number of remote calls)

    Thank you,
    Moreno