• 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

Problem with XA Transactions in JBoss when use multiple datasources for related tables

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Help me please with XA transactions.

I can't create two records in two related tables of differents schemas from DB2 AS400 database.

I'm developing an application with EJB 3.1, JPA 2.0, Hibernate 3.6.5, JBoss AS 6.0, DB2 AS400. All it's configured with XA transactions support.

I have two tables:KSSEGTUSER in DSMXMBASE schema, SSPCOTFUNCIONARIO in DSMXCORP schema.






KSSEGTUSER is mapped to UserDTO JPA 2.0 entity bean in the prjFrameworkV2 project.

SSPCOTFUNCIONARIO is mapped to FuncionarioDTO JPA 2.0 entity bean in the prjCorporativoV2 project.



For create or update the UserDTO, I have a Singleton Session bean named UsuarioServiceImpl, it has a UsuarioServiceLocal by Local Session Bean interface and it has a UsuarioServiceRemote by Remote Session Bean interface.



For create or update the FuncionarioDTO, I have a Singleton Session bean named FuncionarioServiceImpl, it has a FuncionarioServiceLocal by



Local Session Bean interface and

it has a FuncionarioServiceRemote by Remote Session Bean interface.



In the create method of funcionario of FuncionarioServiceImpl I'm calling to create method of usuario of UsuarioServiceImpl via EJB Local injection.



The problem is that I don´t insert the user and employee in same transaction, the application throw an exception when inserting the employe, the stack trace is:







But when I deploy the same application in GlassFish 3.1, the application works fine. The funcionario and usuario was cretead sucessfully.

I'm testing this functionality via Servlet http://localhost:8080/prjCorporativoWeb/Transaccion.



Help me please. How to configure the JBoss 6.0 to works in this scenario? or may be the problem is the application?



Please see the source of attachments.



Thanks.
 
This will take every ounce of my mental strength! All for a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic