3 Replies Latest reply on Aug 14, 2007 3:20 PM by tonioc

    Problem calling nested methods or nested EJB

      Hi everybody I'm using 4.0.5-EJB3 with JPA,

      I'm having serious trouble with JTA, it appears to me
      that it is not closing session when nested methods are called,
      or between 2 EJB not deployed in the same ear.

      1st CASE =================================================
      First, my bean schema, Transaction Attribute is REQUIRED
      for al methods:

       List<Integer> getBeingId (String documentNumber);
      
       List<Beings> getBeings(List<Integer> beingsId);
      
       List<Beings> getBeingsWithAddress(String documentNumber) {
       lst=getBeingsId(documentNumber);
       bgs=getBeings(lst);
       for ( Beings b: bgs )
       b.getAddress();
       return bgs;
       }
      


      If I call from my remote client getBeingsWithAddress() the
      memory consuption is continuosly increasing at increadible
      speed, and after 1000 or so called, an OutOfMemory is received.

      A workaround:
      If I put all the function of getBeingsId()/getBeings() in
      getBeingsWithAddress() it works fine.

      Another solution was to use TransactionType.SUPPORTS in
      getBeingsWithAddress() (of course not searching for addresses in this case)

      2nd CASE =================================================
      BUT:
      If getBeingsWithAddress() is a method deployed in an another ear, there
      is no way to stop JBOSS consuming memory.

      I've tried a lot of strange stuff, alway the same bad result.

      Any help will be greatly welcomed
      (In the meanwhile I'm trying to upgrade to 4.2, but I'm having some trouble still)
      Thanks
      tonio





        • 1. Re: Problem calling nested methods or nested EJB

          Well bad news,

          I begin working with 4.2.1-GA, and it works as bad as 4.0.5

          I'm pretty sure I'm making a mistake somewhere, can anybody give
          me a clue where to look for.

          Really I can't believe there is no error-message in logs or clients.

          thanks again
          tonio

          • 2. Re: Problem calling nested methods or nested EJB
            jhalliday

            Stick a profiler on your code to figure out where the memory is being used, but my guess is it's the application rather than the transaction engine. 4.0.5 and 4.2.1 have different default transaction implementations and the chances of both of them leaking memory in the same way are slim.

            • 3. Re: Problem calling nested methods or nested EJB

              Well YOU WERE RIGHT,

              I worked wonderfully well in 4.2.1, I simply started de 4.0.5 instance and
              supposed was the 4.2.1 one, so that was the reason of the same behaviour.

              Everything is working just fine,
              Thank you for make me test again,
              tonio