aspose file tools*
The moose likes JBoss/WildFly and the fly likes Multiple last resources have been added to the current transaction. This is transactionally unsafe a Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Multiple last resources have been added to the current transaction. This is transactionally unsafe a" Watch "Multiple last resources have been added to the current transaction. This is transactionally unsafe a" New topic
Author

Multiple last resources have been added to the current transaction. This is transactionally unsafe a

adi reddy
Greenhorn

Joined: Apr 24, 2012
Posts: 8
I have two DataSource to be executed in EJB bean class.

the following is the my EJB class code:


The AbcTimerLocal is as follows:


In some servelt i am calling the setTimerInterval() method, in this the timer is creating, so that every 5000 millisec the Time Out ( handleCallback(..)) will call. In the callback or time out method i am calling two different DAO's which are call two different DataSources and will execute some SQL statements.

while executing the second DAO method, i am getting the following WARN message in JBoss server.log

WARN [com.arjuna.ats.jta.logging.loggerI18N] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.multipleWarning] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.multipleWarning] Multiple last resources have been added to the current transaction. This is transactionally unsafe and should not be relied upon. Current resource is org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@d38525

My question is , Why I am getting this WARM message and under waht situation will get this message?
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9315
    
109

See https://community.jboss.org/wiki/Multiple1PC

[My Blog] [JavaRanch Journal]
adi reddy
Greenhorn

Joined: Apr 24, 2012
Posts: 8
Thanks JaiKiran,

I ahve seen that link already and i have done some changes in time out method:

i have created one method inside my EJB class as follows:


calling this method in the time out method


according to that thread which you posted, the method which annotated with @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) will execute its own transactional context.
But i dont know what wrong with above code, still I am getting WARN messages.
I have tried to call both DAO methods like above but no use...........
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9315
    
109

adi reddy wrote:
calling this method in the time out method


according to that thread which you posted, the method which annotated with @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) will execute its own transactional context.


You are just doing a plain Java call. So that won't work and won't create a new transaction. See this thread for more details https://community.jboss.org/message/525521#525521
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple last resources have been added to the current transaction. This is transactionally unsafe a
 
Similar Threads
Bean Manage Transaction in Stateful Bean
ejb as abstract ?
EJB Timer issue
android uncaught handler: thread main exiting due to uncaught exception
First Java Program