1 Reply Latest reply on Jun 30, 2006 1:19 AM by Murtuza Vohra

    EJB3 Entity Update takes too long to update

    Murtuza Vohra Newbie

      Hello Everyone,

      I have following setup, WindowsXP, jboss-4.0.4.CR2, MyEclipse IDE and completed developing small inventory program which has following entity

      Category (1-------Many)Product
      Product(1-----------One)Unit
      Movement(1-------Many)Product
      MovementDocument(1----Many)Movement
      (some more documents with dependencies)


      The entities, session bean(stateless) works perfect. I have about 3000 products (expected to grow in double size in a month or two), 500 Categories, and about 50,000 movement lines.

      To add new product: manager.persist(product) takes less than one second (not measure though) buts its update which takes about 30 to 120 seconds. Clearly a bottleneck in the application, here is the code to update Product:

      manager.merge(product);
      manager.find(Product.class, product.getProductNo);
      


      After reading some other threads, i made few corrections in the code like changing all Collection to Set, making all relation LAZY load, removing clustering from JBoss and this has achieved a better result where above mentioned update code now takes 10 secs approx.

      Changing the JVM setting as per thread http://www.jboss.com/index.html?module=bb&op=viewtopic&t=85517 make things worst and the udpate time almost doubles.

      Can anyone help me to fine tune my code or JBoss to acheive more industry standard performance.

      I'll appreciate anyone help.

      Thanks
      Murtuza