1 Reply Latest reply on Jun 20, 2002 7:01 PM by Dain Sundstrom

    How to I get a long running transaction to commit?

    Ryan Ramage Newbie

      Sorry, I dont know if this is the right forum for my question. I have a session bean that is called by a client. This session bean does a lot of stuff and I keep running out of memory during the transaction since it is not persisting the transaction until it is complete.

      I want to know if there is a way to tell the transaction manager to persist the data explicitly. My only other option would be to put more logic back into the client and then have a much smaller session. (I have already increased the VM stack and heap size but I still get a Out of Memory Exception)

      Any Ideas?

        • 1. Re: How to I get a long running transaction to commit?
          Dain Sundstrom Master

          I can think of two things that may help.

          If you change the session bean to have a method that does one chunk of work. You mark that method with tx attribute reqires new. Then when you call that method (through a remote or local interface) the container will suspend the current transaction and start a new one. The new transaction commits independantly of the old transaction. When the new transaction is done (at the end of the method) the old tx is resumed.

          That only works if you can isolate the code to a method. If that does not work you can manage the trasaction directly. I do not recomend this, as it is way more difficult to code an maintain.