[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - "Adding multiple last resources is disallowed" when using En

Janascho do-not-reply at jboss.com
Sun Jan 4 07:19:02 EST 2009


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

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199399#4199399

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199399



More information about the jboss-user mailing list