2 Replies Latest reply on Sep 7, 2012 9:35 AM by yishai

    Error retrieving Database connection in JBoss 7

    yishai

      We are in the process of upgrading from JBoss 6 to JBoss 7. This is the structure of the ear we are deploying

      ear
        
      /lib/jars
        
      /ejb2.jar
        
      /ejb3.jar

      Inside the EJB 3 jar, there are two MBeans (well more, but the point is here). The first one is the startup MBean that establishes the database connectivity (each customer has its own database in this system, so this bean fills a singleton with the relevant customers for this deployment). That works fine and is able to connect to the database without issues using the database pool from JNDI.

      However, the second MBean, which depends on the first so it only starts when the first completes its loading, tries to create a database connection as well using the same mechanism, and JBoss complains with:

      ARJUNA012140: Adding multiple last resources is disallowed. Trying to add LastResourceRecord(XAOnePhaseResource(LocalXAResourceImpl@74bec54d[connectionListener=d3ce980 connectionManager=25b47a05 warned=false currentXid=< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff0a2c28d1:-5a4c1f9a:504689c9:11, node_name=1, branch_uid=0:ffff0a2c28d1:-5a4c1f9a:504689c9:14, subordinatenodename=null, eis_name=unknown eis name >])), but already have LastResourceRecord(XAOnePhaseResource(LocalXAResourceImpl@518d0191[connectionListener=1a05d94a connectionManager=135f1cfe warned=false currentXid=< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffff0a2c28d1:-5a4c1f9a:504689c9:11, node_name=1, branch_uid=0:ffff0a2c28d1:-5a4c1f9a:504689c9:13, subordinatenodename=null, eis_name=unknown eis name >]))

      There is no second database in the mix that it tries to access, so I can't figure out why it complains. Even configuring the system down to one customer, so there is only one database at issue, creates this problem, even though the methods are configured with a NOT_SUPPORTED transaction attribute.

      How can we work around this problem?