Bug 1235886

Summary: [GSS](6.4.z) @Resource injection of UserTransaction does not inject serializable proxy
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: James Livingston <jlivings>
Component: CDI/WeldAssignee: baranowb <bbaranow>
Status: CLOSED CURRENTRELEASE QA Contact: Matej Novotny <manovotn>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4.0CC: amelicha, bbaranow, bmaxwell, cdewolf, jharting, joallen, maschmid, mmusgrov, pmuir, ppalaga, sdouglas, tom.jenkinson
Target Milestone: CR1   
Target Release: EAP 6.4.12   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-17 13:15:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1238925, 1375585    

Description James Livingston 2015-06-26 01:40:33 UTC
@Resource Injecting UserTransaction into CDI beans or EJBs injects the real ServerVMClientUserTransaction which is not serializable, which causes an exception if the EJB is passivated or the CDI bean in session scope and replicated.

A work around is to use @Inject instead, which injects as serializable proxy.

Comment 3 tom.jenkinson 2015-06-30 20:15:07 UTC
I know the Narayana ones are serializable and referenceable: 
JTA: https://github.com/jbosstm/narayana/blob/master/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/UserTransactionImple.java 

JTS: https://github.com/jbosstm/narayana/blob/master/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/UserTransactionImple.java

The app server integration side of things was done long ago - its possible their implementation is not up to date with applicable specs or there was a reason it was not made serializable.

Mike perhaps you can take a look at https://github.com/jbosstm/jboss-transaction-spi/blob/master/src/main/java/org/jboss/tm/usertx/client/ServerVMClientUserTransaction.java and see what can be done. There are some comments from 2013 on there.

Comment 4 James Livingston 2015-07-01 01:40:18 UTC
Given that it's a singleton, readResolve/writeReplace() could presumably be used to make Serializable work.

Comment 11 Petr Penicka 2017-01-17 13:15:31 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.