[Design of JBossCache] - Re: state transfer optimizations - persisitng state with JDB
by manik.surtani@jboss.com
I think the biggest problem will be the in-memory merge and OOMs. One of the primary reasons to use a cache loader is because you have more state in the cache than memory. :-)
Lets think why we bother with the !exists test in memory first. If this is just an optimisation so we don't have to write the state to the DB when the state already exists, then in this case the optimisation doesn't help but hinder. We should just write *everything* to the CL.
The other reason why you may not want to write everything to the CL is if you are using passivation. Then, stuff in-memory should not be in the CL.
So, perhaps this is what we need to do (if we are using a JDBC cache loader only):
1. If !using passivation, write all state to the DB, regardless of whether it exists in memory or not.
2. If using passivation, when attempting to deserialize state to put into your batch, ignore statements which pertain to Fqns that are in memory.
I agree about having configurable batch size limits, with perhaps a 1k batch size default.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4155321#4155321
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4155321
17 years, 10 months
[Design of JBossCache] - state transfer optimizations - persisitng state with JDBCCac
by mircea.markus
Background: When integrating persistent state, individual insert operations are being triggered on JDBCCacheLoader. This might be optimized by batching these insert calls, though gaining significant performance.
Now this is the short story, the long one is as that it's not only inserts taking place when transferring persistent state. The general algorithm of transferring state for a node '/a/b/c' is:
a)if ('/a/b/c' does not exists) add nodes /a, /a/b and /a/b/c (ones that !exist)
else //it exists
b) replace ('/a/b/c') existing attributes with the new ones.
in the case of a) there are 2*Fqn.size db interactions (an exists and an insert for each new node) + an initial query to check whether the node exists
in the case of b) there are 2 query only (initial one for existence and one for update)
Considering that this is done for each transfered node, performance is low.
Another approach would be to:
- read all the pre-existing state in memory (1 query)
- do a merge in memory
- persist all merged state in one batch ( 2 batch operations are actually necessary as some updates also need to be performed)
At a glance this should be much efficient as it reduces the number of DB interactions to 3.
Issues that might be with the new approach:
- all pre-existing state would be loaded in memory for the merge. High memory consumption; possible OOM
- if there are too many statements in the batch, there might be a failure at commit time: I remember having problems on Oracle with 10k stamens in a batch. This might be fixed though, splinting into 1k (configurable) sized batches
- others?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4155281#4155281
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4155281
17 years, 10 months
[Design of JBoss jBPM] - Re: ending a process from other token than root token
by nizzy
Hi
Interestingly in my debug, I see that node-entered is the required end state however execution of the process does not finish at this point!
| 10:47:20,613 [main] INFO ForkTest : Signaling: Waiting for a
| 10:47:20,613 [main] DEBUG ForkTest : inside signal(instance, childKey = a)
| 10:47:20,613 [main] DEBUG GraphElement : event 'before-signal' on 'State(wait for a)' for 'Token(/a)'
| 10:47:20,613 [main] DEBUG GraphElement : event 'node-leave' on 'State(wait for a)' for 'Token(/a)'
| 10:47:20,613 [main] DEBUG GraphElement : event 'transition' on 'Transition(148aa23)' for 'Token(/a)'
| 10:47:20,613 [main] DEBUG GraphElement : event 'node-enter' on 'Node(doThis2)' for 'Token(/a)'
| 10:47:20,613 [main] DEBUG GraphElement : executing action 'Action(a46701)'
| 10:47:20,613 [main] DEBUG DoThis2ActionHandler : Calling leaveNode("failure")
| 10:47:20,613 [main] DEBUG GraphElement : event 'node-leave' on 'Node(doThis2)' for 'Token(/a)'
| 10:47:20,613 [main] DEBUG GraphElement : event 'transition' on 'Transition(failure)' for 'Token(/a)'
| 10:47:20,613 [main] DEBUG GraphElement : event 'node-enter' on 'EndState(end - doThis2 failed)' for 'Token(/a)'
| 10:47:20,613 [main] DEBUG GraphElement : event 'process-end' on 'ProcessDefinition(forktest)' for 'Token(/)'
| 10:47:20,613 [main] DEBUG GraphElement : event 'after-signal' on 'State(wait for a)' for 'Token(/a)'
| 10:47:20,613 [main] INFO ForkTest : **************************************************
| 10:47:20,613 [main] INFO ForkTest : just performed action: 2. signal(instance, "wait for a")
| 10:47:20,613 [main] INFO ForkTest : root token node: Fork(fork1)
| 10:47:20,613 [main] INFO ForkTest : root token active children: {}
| 10:47:20,613 [main] INFO ForkTest : **************************************************
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4155271#4155271
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4155271
17 years, 10 months
[Design of JBoss jBPM] - Re: ending a process from other token than root token
by nizzy
Hi,
I have attached the update schema to the jira issue created by Tom.
This fixed the exception I was seeing. However I'm still not seeing the behaviour from the process execution that I would expect.
Could someone have a look at my test process definition and see if I'm doing something wrong
<?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition xmlns="" name="forktest">
|
|
| <start-state name="start">
| <transition to="doThis1"></transition>
| </start-state>
|
|
| <node name="doThis1">
| <transition to="fork1"></transition>
| </node>
|
| <fork name="fork1">
| <transition to="wait for a" name="a"></transition>
| <transition to="wait for b" name="b"></transition>
| </fork>
|
| <node name="doThis2">
| <action class="com.ecebs.sample.action.DoThis2ActionHandler"></action>
| <transition to="join1" name="success"></transition>
| <transition to="end - doThis2 failed" name="failure"></transition>
| </node>
|
| <node name="doThis3">
| <action class="com.ecebs.sample.action.DoThis2ActionHandler"></action>
| <transition to="join1" name="success"></transition>
| <transition to="end - doThis3 failed" name="failure"></transition>
| </node>
|
| <join name="join1">
| <transition to="wait state"></transition>
| </join>
|
| <state name="wait for a">
| <transition to="doThis2"></transition>
| </state>
|
| <state name="wait for b">
| <transition to="doThis3"></transition>
| </state>
|
| <state name="wait state">
| <transition to="end"></transition>
| </state>
|
|
| <end-state name="end" />
| <end-state name="end - doThis2 failed" end-complete-process='true'/>
| <end-state name="end - doThis3 failed" end-complete-process='true'/>
|
|
| </process-definition>
I set in the ContextInstance a variable that I use to define success or failure, i.e. if success then I call
ctx.leaveNode("success")
from my action handler, if it fails then I calll same method passing in failure.
I still dont see the process completing at the expected end-state which leads me to believe I'm doing something wrong, either in my process definition or my test code
test code is
| @Test
| public void testFork() {
| if (log.isDebugEnabled()) {
| log.debug("inside testFork()");
| }
|
| // Create an instance of the process definition.
| ProcessInstance instance = new ProcessInstance(processDefinition);
| debugState("new ProcessInstance()", instance);
| log.debug("ProcessId is " + instance.getId());
|
| // Signal to Start Process
| log.info("Signaling: Start");
| signal(instance, null);
| debugState("1. Start", instance);
|
| ContextInstance ctxInst = instance.getContextInstance();
| ctxInst.setVariable("status", "failure");
|
| // Signal: Waiting for a
| log.info("Signaling: Waiting for a");
| signal(instance, "a");
| debugState("2. signal(instance, \"wait for a\")", instance);
|
| ctxInst.setVariable("status", "success");
|
| // Signal: Waiting for a
| log.info("Signaling: Waiting for b");
| signal(instance, "b");
| debugState("3. signal(instance, \"wait for b\")", instance);
|
| // Signal: Waiting for a
| log.info("Signaling: to exit wait");
| signal(instance, null);
| debugState("3. signal(instance, \"null\")", instance);
|
| Assert.assertEquals(processDefinition.getNode("end - doThis2 failed"), instance.getRootToken().getNode());
| //Assert.assertEquals(processDefinition.getNode("end"), instance.getRootToken().getNode());
| }
|
| private void debugState(String action, ProcessInstance instance) {
| log.info("**************************************************");
| log.info("just performed action: " + action);
| log.info("root token node: " + instance.getRootToken().getNode());
| log.info("root token active children: "
| + instance.getRootToken().getActiveChildren());
| log.info("**************************************************");
| }
|
| private void signal(ProcessInstance instance, String childKey) {
| if (log.isDebugEnabled()) {
| log.debug("inside signal(instance, childKey = " + childKey + ")");
| }
|
| Token rootToken = instance.getRootToken();
| if (rootToken.hasActiveChildren()) {
| Map<?, ?> children = rootToken.getActiveChildren();
| if (children.containsKey(childKey)) {
| Token childToken = (Token) children.get(childKey);
| childToken.signal();
| } else {
| // TODO handle this
| String msg = "Root Token does not contain, " + childKey;
| log.debug(msg);
| throw new RuntimeException(msg);
| }
| } else {
| rootToken.signal();
| }
| }
|
Help is much appreciated!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4155256#4155256
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4155256
17 years, 10 months
[Design of JCA on JBoss] - Re: The current implementation of the JCA deployers is broke
by vickyk
anonymous wrote : It shouldn't be in the parsing deployer and currently there is no remove. Moving the
After moving the addition/deletion of the metadata in the real deployer I realized that the default deployment of the hsqldb-ds.xml does not work .
The MainDeployer makes these calls
1) It calls the RARParserDeployer which parses the ra.xml+jboss-ra.xml .
2) It next calls the MCF ParserDeployer/Deployer(real Deployer) which is unable to get the ConnectorMetaData from the MetaData repository and thus the deployment fails during the start up .
3) The RARDeployer( real deployer) then does the deployment of the RAR and puts the MetaData in the repository .
If we deploy the -ds.xml after the [3] it will work , but the initial(startup) deployment of the hsqldb-ds.xml will not be done unless the metadata is not made available through the RARParserDeployer.
If the MainDeployer calls the RAR(parser/real) and then MCF(parse/real) in sequence then adding/removing of the MetaData in the real deployers will work , is this possible ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4155236#4155236
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4155236
17 years, 10 months
[Design of JBoss Portal] - how to display page names in Portal according to our view
by dilipreddy
Hi
I am new to the JBoss Portal technologies..
I am creating one portal instance "Saven" and in this I am displaying pages, but it is not dislplaying which are mentioned in the *-object.xml
it is taking on alphabets order
here is my savenportal-object.xml , I metione pages as
<portal-name>Saven</portal-name>
<!-- Set the layout for the default portal -->
<!-- see also portal-layouts.xml -->
<!-- -->
<!-- -->
<!-- layout.id-->
<!-- phalanx-->
<!-- -->
<!-- -->
<supported-modes>
view
edit
help
</supported-modes>
<supported-window-states>
<window-state>normal</window-state>
<window-state>minimized</window-state>
<window-state>maximized</window-state>
</supported-window-states>
<page-name>WatchList</page-name>
<page-name>Portfolio</page-name>
<page-name>OrderManagement</page-name>
<page-name>OrderBook</page-name>
<page-name>OptionChain</page-name>
<page-name>StockSimulator</page-name>
<page-name>Currency</page-name>
in the browser it is displaying from currency, oreder....watchlist,home
I want to display first watchlist in my portal
how can I achieve it
please help me regarding this issue....
Thank & Regards,
Dilip
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4155226#4155226
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4155226
17 years, 10 months