0 Replies Latest reply on Jan 4, 2009 7:18 AM by Harry Hirsch

    "Adding multiple last resources is disallowed" when using En

    Harry Hirsch Newbie

      Hello.

      I am using JBoss 4.2.3GA, MySQL 5 and use EJB3 within my application.

      What I want to do is create a (ejb-)timer (Notifier) per entity (MatchDay) which is going to do some logic on expiration. Obviously those timers are stored somewhere else than my entities and when creating them (after creation of a new MatchDay) I get the following error:

      - "Adding multiple last resources is disallowed"

      I already figured out that I have several possibilities to solve the problem. (http://www.jboss.org/community/docs/DOC-11443)

      What I now want to do is avoid using xa-datasources. I tried annotading the creation-logic for the timer with @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) which worked for this case.
      But when the timeout-method is invoked I am going to select entities from the db and therefore are facing the same problem again. Here annotating the getMyEntities (it's read-only) method with @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) does not work for me.

      I have no clue what I could do or how I could rework it to a single-phase transaction (the third idea from above's url). I hope someone of you is more professional than me to face that problem.

      Thank you in advanced. Jan