7 Replies Latest reply on Mar 26, 2004 2:41 AM by keesvandieren

    possible memory leak in long lived transaction ?

    grzegorzgłowaty

      Hello.
      Is there any way to implement a really long lived transaction in JBoss?
      What I'm trying to implement is a big import involving creation of thousands
      of entity beans (special bussiness logic is involved so it cannot be done by
      simple database tables import). I can guarantee that I'm the only user of
      Jboss working during this import so this transaction really doesn't need to
      lock anything. It only should allow ATOMICITY so it will be rolled back
      completelly if sth fails.
      I'm using JBoss 3.2.3
      On the default (Standard CMP) configuration I got "unable to passivate due
      to ctx lock" after the cache becomes full. Eventually it leads to "out of
      memory". It's obvious because Standard CMP uses pessimistic locking.

      So I tried to execute it on "Instance per transaction" configuration with
      NoLock and it no longer produces "unable to passivate" as it passivates
      beans, but memory used still grows up, but slower (the question here is why
      as the beans are passivated?) and finally I get "Out of memory exception".
      There's no possibility of a memory leak on my code because if I do the above
      in small transactions everything works fine.
      So my question is: how to assure the atomicity of the big import operation
      (as I mentioned I don't need any locking during the import as my import
      transaction is the only one performing in the system).

      Greetings,

      greg