0 Replies Latest reply on Feb 11, 2007 9:02 AM by Brian McGovern

    Is this app design for my portal app good or bad.

    Brian McGovern Newbie

      I have a portal w/ multiple portlets that talk to my database. I'm using hibernate 3.2, jboss app server/portal server bundle.

      Each page of the portal has between 3 and 7 portlets that each make a call to my single business object which gets 1 hibernate session from the factory PER METHOD and sends it in the constructor of each DAO that I use. The business method starts, then either commits, or rolls back the tx.

      If I refresh any portal page multiple times in a row, very quickly, I get "wrong tx on thread" errors. Debugging the output, it seems that under that high concurrency, which i guess really isnt that high, the same TX is attempted to be committed by different sessions.

      Is my design sound? Looking for help on how to debug.

      Heres a little diagram.. Hope it makes sense.

      Portal Page contains [ portletA, portletB, portletC ] each portlet calls a
      |
      |--->Business Class [methodA(), methodB(), methodC()]
       |
       |--->Various DAOs, each passed a session from prev layer.
       [DAOa.findbyID(), DAOb.findbyID(), DAOc.findbyID()]


      Incidently, I've had same problems using JTA OR JDBC transactions. I've swapped out the default jboss connection pool with c3po and i do get better performance but it still breaks after refreshing like 5 x in a row.

      I'm at a point where i think it might be a flaw in the portal architecture, but I cannot say that without first verifying that i'm not causing the issue with bad design.