Scout/Concepts/JAXWS-RT/Transactional handlers
Scout |
Wiki Home |
Website |
Download • Git |
Community |
Forums • Blog • Twitter • G+ |
Bugzilla |
Bugzilla |
Scout |
Wiki Home |
Website |
Download • Git |
Community |
Forums • Blog • Twitter • G+ |
Bugzilla |
Bugzilla |
Handlers can be annotated to run in a ServerJob. That means that there is spanned a new transaction before the request is passed to the handler. Thereto, annotate the handler with @ScoutTransaction
. Optionally, you can provide the annotation an IServerSessionFactory to be used to run the transaction. If not specifying a session factory, the DefaultServerSessionFactory is used instead, meaning that simply a new ServerSession is created at the handler's initialization. When a webservice request is passed to the handler, this session is used in order to create the transaction.
Please note, that when having a webservice providers, the session for their transactional handlers is created prior to the request's authentication. That is why it is created on behalf of the user 'anonymous'. You can change 'anonymous' by specifying the property org.eclipse.scout.jaxws216.txhandler.sessionfactory.principal
in config.ini with a designated principal to be used to create the session for transactional headers.
org.eclipse.scout.jaxws216.txhandler.sessionfactory.principal=xy
Because consumers typically run on behalf of a subject, the previous section with the 'anonymous' prinicpal is not applicable.