jax ws - How to expose an EJB as a web service that is not transactional? -


i have ejb (coded using java ee 6 annotations) defined follows:

@stateless @webservice public class securitywebservice {      public void registeruser(registrationrequest request) {         ...     } } 

note ejb exposed web service. however, running issue generated web service. wsdl generated container (glassfish) contains ws-atomic transaction policies because stateless session bean default transactional (see details here). unfortunately .net client choking on wsdl because not understand ws-at policies.

so want nice-clean web service not transactional, associated ejb should transactional (it has insert records in database). how do this? approach can think of create "normal" web service passes calls ejb - not elegant @ all:

@webservice public class securitywebservice {      @inject     private securityservice securityservice;      public void registeruser(registrationrequest request) {         securityservice.registeruser(request);     } }  @stateless public class securityservice {      public void registeruser(registrationrequest request) {         ...     } } 

is there better way?

thanks.

naresh

you can try annotating method:

@transactionattribute(transactionattributetype.never) 

or

@transactionattribute(transactionattributetype.not_supported) 

dunno if web service pick or not, it's worth shot.

edit comment:

did try requires_new? may not propagate out web service.

otherwise, yea, you'll stuck facading transactional part non-transactional web service.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -