• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See https://community.jboss.org/wiki/Multiple1PC
 
adi reddy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic