1 Reply Latest reply on Jan 8, 2002 4:57 PM by Peter Sojan

    Question regarding (possible) distributed transaction

    Peter Sojan Newbie

      Ok since I got no answer on the database forum, I´ll take another try in this one:

      The question is wether the following scenario is possible with JBoss:

      A "controller" session bean (SB) interacts with two entity (BMP) beans (EB1 & EB2), whereas the session bean acts as a facade to clients which never see the entity beans directly. Every entity bean is responsible for a specific table in the *SAME* database. Besides other things the controller session bean manages relationships between those two entity beans.

      Now the concrete transaction scenario: Transaction attributes are set to "required" for every bean involved. A client now calls the controller (SB) which in turn updates EB1 and afterwards EB2. According to spec this must now happen all in the same transaction context. If now something goes wrong within EB2 will the updates to EB1 also be rolled back!?

      I think the crucial point here is, wether this is regarded as a distributed transaction. Due to the fact, that most JDBC drivers dont support distrib. trx this would mean that the case above could not be handled correctly. However, it could be that (since the *SAME* ressource manager is involved) this is NOT regarded as a distrib. trx. In that case everything should work.

      Any hints!?

      P.S. I use Postgresql and I´m not quite sure if the JDBC driver handles distributed trx. However by investigating the source one can find many "XA" things in there ...!?

      P.P.S Instead of using a session bean in front of the Entity Beans, could I use another Entity Bean!? This would be an "aggregating" EB which effectively makes no database access, but acts as a "view" on other entity beans. Are there any pros/cons regarding such a pattern!?