Thursday 15 August 2013

java - Can anyone point me to an alternative for JavaEE SessionContext -



java - Can anyone point me to an alternative for JavaEE SessionContext -

within java ee context, in cdi applicationscoped object, need forcefulness rollback of container-managed transaction. (it's combination of jpa (trans-)action , filesystem action, later not transactional, have manually things)

i able utilize sessioncontext before, after injection of more dependencies, framework (weld cdi within wildfly 8.1.0) not mark applicationscoped object session- or message-driven bean anylonger. (according error-message , rightfully so)

so question is: there alternative? did usertransaction, 'suffers' same limitation sessioncontext.

i came across a post jaikiran pai-2 triggered me alternative called transactionsynchronizationregistry, argued way go in these situations. (quote: usage of api explained , applications/libraries maintain using usertransaction instead.)

i had annotate injection-point using code:

@resource(name = "java:comp/transactionsynchronizationregistry") private transactionsynchronizationregistry transactionsynchronizationregistry;

i tried , worked charm.

java java-ee jpa cdi jta

No comments:

Post a Comment