java ee - How to correctly setup distributed transactions in JBoss AS 7.1? -


my scenary: java ee application calls method ejb, both hosted in jboss 7.1.1 server. during insert , update operations in crud page, jsf application has save own data using own datasource , additionally save other data in other application calling ejb methods, use other datasource. both datasources configured use jta (jta checkbox marked in jboss datasource parameters);

only during update operations, attempt save data throws exception. last parts of exception stack follows:

caused by: java.sql.sqlexception: javax.resource.resourceexception: ij000457: unchecked throwable in managedconnectionreconnected() cl=org.jboss.jca.core.connectionmanager.listener.txconnectionlistener@14729cfa[state=normal managed connection=org.jboss.jca.adapters.jdbc.local.localmanagedconnection@6a370d1a connection handles=0 lastuse=1467805740289 trackbytx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.onepool@7a5d9cca pool internal context=semaphorearraylistmanagedconnectionpool@31c571ea[pool=cartaods] xaresource=localxaresourceimpl@11061a5f[connectionlistener=14729cfa connectionmanager=4b45c7aa warned=false currentxid=null] txsync=null] @ org.jboss.jca.adapters.jdbc.wrapperdatasource.getconnection(wrapperdatasource.java:147) @ org.hibernate.service.jdbc.connections.internal.datasourceconnectionproviderimpl.getconnection(datasourceconnectionproviderimpl.java:141) @ org.hibernate.internal.abstractsessionimpl$noncontextualjdbcconnectionaccess.obtainconnection(abstractsessionimpl.java:281) @ org.hibernate.engine.jdbc.internal.logicalconnectionimpl.obtainconnection(logicalconnectionimpl.java:297) ... 175 more caused by: javax.resource.resourceexception: ij000457: unchecked throwable in managedconnectionreconnected() cl=org.jboss.jca.core.connectionmanager.listener.txconnectionlistener@14729cfa[state=normal managed connection=org.jboss.jca.adapters.jdbc.local.localmanagedconnection@6a370d1a connection handles=0 lastuse=1467805740289 trackbytx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.onepool@7a5d9cca pool internal context=semaphorearraylistmanagedconnectionpool@31c571ea[pool=cartaods] xaresource=localxaresourceimpl@11061a5f[connectionlistener=14729cfa connectionmanager=4b45c7aa warned=false currentxid=null] txsync=null] @ org.jboss.jca.core.connectionmanager.abstractconnectionmanager.reconnectmanagedconnection(abstractconnectionmanager.java:604) @ org.jboss.jca.core.connectionmanager.abstractconnectionmanager.allocateconnection(abstractconnectionmanager.java:467) @ org.jboss.jca.adapters.jdbc.wrapperdatasource.getconnection(wrapperdatasource.java:139) ... 178 more caused by: javax.resource.resourceexception: ij000461: not enlist in transaction on entering meta-aware object @ org.jboss.jca.core.connectionmanager.tx.txconnectionmanagerimpl.managedconnectionreconnected(txconnectionmanagerimpl.java:474) @ org.jboss.jca.core.connectionmanager.abstractconnectionmanager.reconnectmanagedconnection(abstractconnectionmanager.java:599) ... 180 more caused by: javax.transaction.systemexception: ij000356: failed enlist: java.lang.throwable: unabled enlist resource, see previous warnings. tx=transactionimple < ac, basicaction: 0:ffff0a0a0546:2fd05d09:577134fa:61c7a status: actionstatus.abort_only > @ org.jboss.jca.core.connectionmanager.listener.txconnectionlistener$transactionsynchronization.checkenlisted(txconnectionlistener.java:552) @ org.jboss.jca.core.connectionmanager.listener.txconnectionlistener.enlist(txconnectionlistener.java:282) @ org.jboss.jca.core.connectionmanager.tx.txconnectionmanagerimpl.managedconnectionreconnected(txconnectionmanagerimpl.java:467) ... 181 more 

when disable jta in ejb datasource, problem disappears.

what wrong environment?

thanks in advance!

update 1

i requested give more information, there goes.

this use case makes problem happen:

  1. user clicks in link on screen lead him/her edit page
  2. in edit page, user changes values , clicks save button
  3. the save button calls update() method in managed bean serves page
  4. the update method begins transaction , runs 2 other methods: 1 acts on ds declared web application (to save local data), other ejb method exposes functionality another application (to save data in context of other application)

both dss path same data server , both applications hosted in same jboss instance.

the first method works fine, second produces error. since exception thrown, entire transaction rolled , nothing happens in database.

in understanding, simple case of application integration, 1 applications integrates 1 using java ee standard technology, is, ejb call.

i hope helps case.

i did not how sequence like. guess jsf app use ejb use ds, right? same application , server.

if have more 1 ds need have xa-datasource, did have it? please share ds configuration , more information config/app , warnings in logile (best complete call-sequence) if have further questions.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -