[JBoss Seam] - ManagedPersistenceContext in clustered environment -> closed
by cpopetz
Hello,
ManagedPersistenceContext, upon passivation, checks to see if the entity manager is dirty, and if not, closes it. I presume this is intended as an optimization. But in a clustered environment, where a snapshot of the session is taken upon each request that dirties the session, passivation will occur frequently within a conversation. In this case, the entity manager is frequently closed and recreated upon the next request, and entities in conversational beans become detached, and all sorts of bad things happen when I try to use them in the new session.
I think that to preserve the promise of long conversations, we have to keep the persistence context open across passivation, regardless of whether it's dirty.
Am I misunderstanding something? If not, please verify this is problematic, and I'll file a Jira issue.
Thanks,
-Clint
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117587#4117587
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117587
18 years, 3 months
[JBoss Seam] - Re: Injecting Remote EJBs
by cavani
Something like this:
| @Name("managedRemoteServer")
| @Scope(ScopeType.STATELESS)
| public class ManagedRemoteServer
| {
|
| @Unwrap
| public ManagementService getRemoteServer()
| {
| try
| {
| Properties env = new Properties();
| env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
| env.put(Context.PROVIDER_URL, "jnp://192.168.1.1:1099");
|
| Context ctx = new InitialContext(env);
|
| return (ManagementService) ctx.lookup("tlon/ManagementServiceBean/remote");
| }
| catch (Exception e)
| {
| e.printStackTrace();
| }
|
| return null;
| }
|
| }
|
And:
|
| @In
| private ManagementService remoteServer;
|
|
Obs.: I didn't test this...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117586#4117586
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117586
18 years, 3 months
[JBoss jBPM] - Nodetype decision: error when use handler class approach
by dadajboss
Hi all.
Running my sample process from JBoss jBPM Console I have the error:
Error completing task: An exception of type "org.jbpm.graph.def.DelegationException" was thrown.
The sample process definition:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="Process_3">
|
| <start-state name="SN-acquire">
| <task name="AcqData">
| <controller>
| <variable access="read,write" name="qta" mapped-name="qta"></variable>
| </controller>
| </task>
| <transition to="TN_display1"></transition>
| </start-state>
|
|
| <decision name="N_decision">
| <handler class="com.Process_3.decision.MyDecisionHandlerNew"></handler>
| <transition to="TN_display" name="tr_true"></transition>
| <transition to="N_end" name="tr_false"></transition>
| </decision>
|
| <task-node name="TN_display">
| <task name="DisData"></task>
| <transition to="N_end" name="to_end"></transition>
| </task-node>
|
| <task-node name="TN_display1">
| <task name="display1"></task>
| <transition to="N_decision"></transition>
| </task-node>
|
|
| <end-state name="N_end"></end-state>
|
| </process-definition>
The decide-method of the DecisionHandler implementation:
package com.Process_3.decision;
|
| import org.jbpm.graph.exe.ExecutionContext;
| import org.jbpm.graph.node.DecisionHandler;
|
| public class MyDecisionHandlerNew implements DecisionHandler {
| private static final long serialVersionUID = 1L;
| public String decide(ExecutionContext executionContext) throws Exception {
| String quantity = (String) executionContext.getContextInstance().getVariable("qta");
| if (Integer.parseInt(quantity) > 10) {
| return "tr_true";
| }
| else {
| return "tr_false";
| }
| }
| }
Can somebody help me?
Thank you so much!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117584#4117584
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117584
18 years, 3 months
[JBoss Seam] - Re: Injecting Remote EJBs
by cavani
I am using this:
| Properties env = new Properties();
| env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
| env.put(Context.PROVIDER_URL, "jnp://192.168.1.1:1099");
|
| Context ctx = new InitialContext(env);
|
| return (ManagementService) ctx.lookup("tlon/ManagementServiceBean/remote");
|
where there is two ears on different AS instance (and machines). "tlon" is the name of second EAR. "ManagementService" interface is deployed in both. Both application are Seam basead.
I think (but don't tryed) tou could use factory or unwrap annotation to encapsulate and use in annotation for injection.
Thanks,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117578#4117578
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117578
18 years, 3 months