[JBoss Cache: Core Edition] - Re: Recommendation for IsolationLevel
by kringdahl
Well, high transaction may have been overshooting a little bit. What we really need is guaranteed consistency of writes. We have chosen a caching solution because we have a distributed application where reads need to be very fast and writes typically happen outside of the normal user data path (e.g. we have inventories that are collected on a periodic basis). Anyway, the scenario I describe is actually very similar to what's described here:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=114513
Which ultimately means that we're looking at MVCC. In the meantime I am thinking of implementing our own mutex lock within the cache itself to help synchronization across the cluster. If we do this, we can change the IsolationLevel back to something more reasonable like REPEATABLE_READ as you say. My interpretation of SERIALIZABLE is that access to a particular node would be locked when first read inside of a transaction. But this appears to happen during the commit phase and we still have contention of resources.
Also, we have tried OPTIMISTIC locking but it seems to have problems with our cache loader. We use a JDBC cache loader and preload the / node. We see exceptions when the cache first initializes and tries to preload the cache. Is this a known problem? I can certainly recreate this and provide the stack trace if it helps.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4155952#4155952
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4155952
16 years, 5 months
[JBoss jBPM] - Re: Does JBPM Supports fully actor based taskList
by csplrj
The files as per below
Thanks in advance
CSJakharia
processdefinition.xml
<?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="authoring">
| <start-state name="start-state1">
| <task>
| </task>
| <transition to="task1"></transition>
| </start-state>
|
|
| <task-node name="task1">
| <description>
| task1
| </description>
| <task>
| <assignment class="com.workflow.AssignTask"></assignment>
| </task>
| <transition to="task2"></transition>
| </task-node>
|
| <task-node name="task2">
| <description>
| task2
| </description>
| <task>
| <assignment class="com.workflow.AssignTask1"></assignment>
| </task>
| <transition to="end"></transition>
| </task-node>
|
| <node name="end">
| <action class="com.workflow.HandleAction"> </action>
| <transition to="end-state1"></transition>
| </node>
|
|
| <end-state name="end-state1">
|
| </end-state>
|
|
| </process-definition>
AssignTask.java
public class AssignTask implements AssignmentHandler {
|
| public void assign(Assignable assignable, ExecutionContext executionContext)
| throws Exception {
| // TODO Auto-generated method stub
| assignable.setActorId("b");
| }
|
| }
AssignTask1.java
public class AssignTask1 implements AssignmentHandler {
|
| public void assign(Assignable assignable, ExecutionContext executionContext)
| throws Exception {
| // TODO Auto-generated method stub
| assignable.setActorId("a");
| }
|
| }
Test.java
| import java.io.FileInputStream;
| import java.io.FileNotFoundException;
| import java.util.Set;
|
| import org.jbpm.JbpmConfiguration;
| import org.jbpm.JbpmContext;
| import org.jbpm.db.GraphSession;
| import org.jbpm.db.TaskMgmtSession;
| import org.jbpm.graph.def.ProcessDefinition;
| import org.jbpm.graph.exe.ProcessInstance;
| import org.jbpm.graph.exe.Token;
| import org.jbpm.taskmgmt.exe.PooledActor;
| import org.jbpm.taskmgmt.exe.TaskInstance;
|
| public class Test {
| static JbpmConfiguration jbpmConfiguration = null;
|
| public static void deployProcessDefinition()
| {
| try {
| ProcessDefinition processDefinition = ProcessDefinition.parseXmlInputStream(new FileInputStream("D:\\Cobra\\workspace\\WorkFlowAuthoringPOC\\src\\main\\jpdl\\authoring\\processdefinition.xml"));
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
| jbpmContext.deployProcessDefinition(processDefinition);
| jbpmContext.close();
| } catch (FileNotFoundException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
| }
|
| /**
| * @param args
| */
| public static void main(String[] args) {
| // TODO Auto-generated method stub
| try {
| jbpmConfiguration = JbpmConfiguration.parseInputStream(new FileInputStream("D:\\Cobra\\workspace\\WorkFlowAuthoringPOC\\src\\main\\config\\jbpm.cfg.xml"));
| jbpmConfiguration.createSchema();
| deployProcessDefinition();
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
| System.out.println("jbpmContext.getActorId() "+jbpmContext.getActorId());
| GraphSession graphSession = jbpmContext.getGraphSession();
| ProcessDefinition processDefinition =
| graphSession.findLatestProcessDefinition("authoring");
| ProcessInstance processInstance = new ProcessInstance(processDefinition);
| Token token=processInstance.getRootToken();
| // Let's start the process execution, leaving the start-state
| // over its default transition.
| token.signal();
| TaskInstance taskInstance = (TaskInstance)
| processInstance
| .getTaskMgmtInstance()
| .getTaskInstances()
| .iterator().next();
|
| System.out.println("size "+processInstance.getTaskMgmtInstance().getTaskInstances().size());
| System.out.println("taskInstance.getActorId() " +taskInstance.getActorId());
| System.out.println("taskInstance.getPooledActors() " +taskInstance.getPooledActors());
| TaskMgmtSession taskMgmtSession= jbpmContext.getTaskMgmtSession();
| System.out.println(taskMgmtSession.findPooledTaskInstances("a").size());
| System.out.println(taskMgmtSession.findPooledTaskInstances("b").size());
| ((TaskInstance)taskMgmtSession.findTaskInstances("b").get(0)).getToken().signal();
| System.out.println("a1 "+ ((TaskInstance)taskMgmtSession.findTaskInstances("a").get(0)).getToken().getNode().getName());
| System.out.println("b1 "+ ((TaskInstance)taskMgmtSession.findTaskInstances("b").get(0)).getToken().getNode().getName());
| System.out.println("a1 "+ taskMgmtSession.findTaskInstances("a").size());
| System.out.println("b1 "+ taskMgmtSession.findTaskInstances("b").size());
| System.out.println("c1 "+ taskMgmtSession.findTaskInstances("c").size());
|
| } catch (FileNotFoundException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
| }
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4155943#4155943
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4155943
16 years, 5 months