Re: [jboss-user] [EJB 3.0] - Inject TransactionSynchronizationRegistry to stateless EJB
by jaikiran pai
jaikiran pai [http://community.jboss.org/people/jaikiran] replied to the discussion
"Inject TransactionSynchronizationRegistry to stateless EJB"
To view the discussion, visit: http://community.jboss.org/message/544871#544871
--------------------------------------------------------------
> Carlo de Wolf wrote:
>
> The TransactionSynchronizationRegistry should actually be available.
> See https://jira.jboss.org/browse/JBAS-4445 https://jira.jboss.org/browse/JBAS-4445 and JavaEE 6 Final Release - EE.5.11 TransactionSynchronizationRegistry References.
>
> I don't see a test for it though, so that needs to be implemented.
Just checked this again and indeed we do bind the TransactionSynchronizationRegistry to JNDI. The EJBContainer binds it to the ENC and is just a LinkRef to java:TransactionSynchronizationRegistry. After checking the code, I went and looked at the JNDI tree again and it available in JNDI both under java: namespace and even the individual ENC of the beans. I think I missed it the last time I checked the JNDI tree.
> Sergey Kiselev wrote:
>
> I am trying inject TransactionSynchronizationRegistry to stateless EJB:
>
> @Resource
> protected TransactionSynchronizationRegistry transactionSynchronizationRegistry;
>
>
>
>
>
>
> but unfortunately there is throws an error:
>
>
>
> Caused by: java.lang.RuntimeException: mapped-name is required for
> test.BaseService/transactionSynchronizationRegistry of deployment BaseService
>
>
>
>
>
> Also in JNDI not contain TransactionSynchronizationRegistry with name - "java:comp/TransactionSynchronizationRegistry".
>
>
>
>
>
>
Sergey, changing that @Resource injection to:
@Resource (mappedName = "java:TransactionSynchronizationRegistry")
protected TransactionSynchronizationRegistry transactionSynchronizationRegistry;
should get you past that error.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/544871#544871]
Start a new discussion in EJB 3.0 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 11 months
Re: [jboss-user] [jBPM] - [jBPM 4.3] Cancel Job/Timer
by Melih Cetin
Melih Cetin [http://community.jboss.org/people/kafsinkaf] replied to the discussion
"[jBPM 4.3] Cancel Job/Timer"
To view the discussion, visit: http://community.jboss.org/message/544824#544824
--------------------------------------------------------------
Hi HuiSheng,
The simplified process definition is:
<process name="TimerTest" xmlns=" http://jbpm.org/4.3/jpdl http://jbpm.org/4.3/jpdl">
<start g="185,63,48,48" name="start">
<transition g="-44,-18" name="to task1" to="task1"/>
</start>
<task g="162,161,92,52" name="task1" candidate-groups="sales-support">
<transition g="-43,-18" name="to state" to="state"/>
</task>
<state g="162,232,92,52" name="state">
<on event="timeout">
<timer duedate="1 minute" repeat="1 minute"/>
<event-listener class="mytest.TimerTest">
<property name="successTransition">
<string value="toTask"/>
</property>
</event-listener>
</on>
<transition g="-44,-18" name="toTask" to="task"/>
</state>
<task g="162,320,92,52" name="task" candidate-groups="sales-support">
<transition g="-42,-18" name="to end1" to="end"/>
</task>
<end g="183,410,48,48" name="end"/>
</process>
and the simplified event handler where we signal the execution is:
public class TimerTest implements EventListener {
static int cnt = 0;
private String successTransition;
public String getSuccessTransition() {
return successTransition;
}
public void setSuccessTransition(String successTransition) {
this.successTransition = successTransition;
}
public void notify(EventListenerExecution execution) throws Exception {
cnt++;
if (cnt > 2) {
progress(execution);
}
}
public void progress(EventListenerExecution prmEventListenerExecution) {
org.jbpm.api.Configuration.getProcessEngine().getExecutionService().signalExecutionById(prmEventListenerExecution.getId(), successTransition);
}
}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/544824#544824]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 11 months