0 Replies Latest reply on Oct 4, 2007 3:09 PM by Rodney Kite

    EJB Transactions crossing more than one pool causing excepti

    Rodney Kite Newbie


      I thought EJB as a transaction manager provided transactions across multiple database accesses and was not directly tied to an individual database for transactions? Is this not true?

      In my application I use container managed EJB transactions. In one part of my code there is a lookup (simple JDBC SQL) that accesses a different JBoss pool to a different Sybase database running in the same Sybase instance. This worked fine in JBoss4.0.3_sp1. After moving to JBoss 4.2.1 when a connection is fetched from the second pool after a 2.1 Entity bean has been retrieved an exception is raised complaining about trying to create a transaction in an existing transaction. All operations were set to Required in ejb-jar.xml.

      Since the second database accessed in the EJB transaction was just a lookup I put the access in a separate session bean method with trans-attribute NotSupported and created another instance of the session Bean from inside the bean and called it. This was the only work around I could find that worked.