[JBossCache] - POJOCACHE not working properly
by sreejithkt
Hi,
I am using pojocache for replication. I have 4 machines for running my clustered application in Tomcat (Tomcat v 5.5.20 on FC-5 OS with JDK 1.5). One of it is running as loadbalancer and Apache 2.2 is used for that. Tomcat clustering is also enabled. My problem is that only two of my systems are getting participated in cache transaction. i.e. the objects that are put into the cache are not replicated over to other servers and hence I am not able to retrieve them at a later point (when the system from which objects are put into cache goes down)
I have the following conf. for clustering in server.xml of tomcat :
| <Cluster
| className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
| clusterLogName="clusterlog" doClusterLog="true"
| manager.className="org.apache.catalina.cluster.session.DeltaManager"
| manager.expireSessionsOnShutdown="false"
| manager.notifyListenersOnReplication="false"
| manager.notifySessionListenersOnReplication="false"
| manager.sendAllSessions="false" manager.sendAllSessionsSize="500"
| manager.sendAllSessionsWaitTime="20">
|
| <Membership
| className="org.apache.catalina.cluster.mcast.McastService"
| mcastAddr="228.0.0.4"
| mcastClusterDomain="TreeCache-Cluster" mcastDropTime="30000"
| mcastFrequency="200" mcastPort="45564" />
|
| <Receiver
| className="org.apache.catalina.cluster.tcp.ReplicationListener"
| tcpListenAddress="192.168.0.5" tcpListenPort="9015"
| tcpSelectorTimeout="100" tcpThreadCount="6" />
|
| <Sender ackTimeout="15000"
| className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
| doProcessingStats="true" doTransmitterProcessingStats="true"
| doWaitAckStats="true" keepAliveMaxRequestCount="-1"
| keepAliveTimeout="80000" queueCheckLock="true" queueDoStats="true"
| queueTimeWait="true" recoverCounter="6" recoverTimeout="500"
| replicationMode="fastasyncqueue" waitForAck="true" />
|
| <Valve
| className="org.apache.catalina.cluster.tcp.ReplicationValve"
| filter=".*\.gif;.*\.js;.*\.css;.*\.png;.*\.jpeg;.*\.jpg;.*\.html;.*\.txt;"
| primaryIndicator="true" />
|
| <Valve
| className="org.apache.catalina.cluster.session.JvmRouteBinderValve"
| enabled="true" />
| <ClusterListener
| className="org.apache.catalina.cluster.session.ClusterSessionListener" />
| <ClusterListener
| className="org.apache.catalina.cluster.session.JvmRouteSessionIDBinderListener" />
|
| <Deployer
| className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
| deployDir="${catalina.base}/war-deploy/"
| tempDir="${catalina.base}/war-temp"
| watchDir="${catalina.base}/war-listen/" watchEnabled="true" />
| </Cluster>
|
Also my cache config file looks like this :
| <?xml version="1.0" encoding="UTF-8" ?>
|
| <server>
| <mbean code="org.jboss.cache.aop.PojoCache"
| name="jboss.cache:service=PojoCache">
| <depends>jboss:service=TransactionManager</depends>
|
| <!-- Configure the TransactionManager -->
| <attribute name="TransactionManagerLookupClass">
| org.jboss.cache.DummyTransactionManagerLookup
| </attribute>
|
| <!-- Isolation level : SERIALIZABLE
| REPEATABLE_READ (default)
| READ_COMMITTED
| READ_UNCOMMITTED
| NONE
| -->
| <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
|
| <!-- Valid modes are LOCAL, REPL_ASYNC and REPL_SYNC -->
| <attribute name="CacheMode">REPL_SYNC</attribute>
|
| <!-- Just used for async repl: use a replication queue -->
| <attribute name="UseReplQueue">false</attribute>
|
| <!-- Replication interval for replication queue (in ms) -->
| <attribute name="ReplQueueInterval">0</attribute>
|
| <!-- Max number of elements which trigger replication -->
| <attribute name="ReplQueueMaxElements">0</attribute>
|
| <!-- Name of cluster. Needs to be the same for all clusters, in order
| to find each other
| -->
| <attribute name="ClusterName">Sample-Cache</attribute>
|
| <!-- JGroups protocol stack properties. Can also be a URL,
| e.g. file:/home/bela/default.xml
| <attribute name="ClusterProperties"></attribute>
| -->
|
| <!--bind_addr="75.126.68.196" -->
| <attribute name="ClusterConfig">
|
| <config>
| <!-- UDP: if you have a multihomed machine,
| set the bind_addr attribute to the appropriate NIC IP address, e.g bind_addr="192.168.0.2"
| -->
| <!-- UDP: On Windows machines, because of the media sense feature
| being broken with multicast (even after disabling media sense)
| set the loopback attribute to true
| -->
| <UDP mcast_addr="228.1.2.3" mcast_port="48866"
| ip_ttl="64" ip_mcast="true" mcast_send_buf_size="150000"
| mcast_recv_buf_size="80000" ucast_send_buf_size="150000"
| ucast_recv_buf_size="80000" loopback="false" />
| <PING timeout="2000" num_initial_members="3"
| up_thread="false" down_thread="false" />
| <MERGE2 min_interval="10000" max_interval="20000" />
| <FD_SOCK />
| <VERIFY_SUSPECT timeout="1500" up_thread="false"
| down_thread="false" />
| <pbcast.NAKACK gc_lag="50"
| retransmit_timeout="600,1200,2400,4800" max_xmit_size="8192"
| up_thread="false" down_thread="false" />
| <UNICAST timeout="600,1200,2400" window_size="100"
| min_threshold="10" down_thread="false" />
| <pbcast.STABLE desired_avg_gossip="20000"
| up_thread="false" down_thread="false" />
| <FRAG frag_size="8192" down_thread="false"
| up_thread="false" />
| <pbcast.GMS join_timeout="5000"
| join_retry_timeout="2000" shun="true" print_local_addr="true" />
| <pbcast.STATE_TRANSFER up_thread="true"
| down_thread="true" />
| </config>
| </attribute>
|
| <!-- Whether or not to fetch state on joining a cluster -->
| <attribute name="FetchStateOnStartup">true</attribute>
|
| <!-- The max amount of time (in milliseconds) we wait until the
| initial state (ie. the contents of the cache) are retrieved from
| existing members in a clustered environment
|
| -->
| <attribute name="InitialStateRetrievalTimeout">5000</attribute>
|
| <!-- Number of milliseconds to wait until all responses for a
| synchronous call have been received.
| -->
| <attribute name="SyncReplTimeout">15000</attribute>
|
| <!-- Max number of milliseconds to wait for a lock acquisition -->
| <attribute name="LockAcquisitionTimeout">10000</attribute>
|
| <!-- Name of the eviction policy class. -->
| <attribute name="EvictionPolicyClass" />
| </mbean>
| </server>
|
Any help would be much appreciated !!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043639#4043639
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043639
19 years
[JBoss Seam] - Re: OneToMany List refresh after insert
by damianharvey
I've recreated this with a simple example using Seam Gen. If you have a PERSON entity and a CITY entity. Then you wish to show a list of CITYs with a column holding a ui:repeat (or similar) displaying all associated PERSONs. The cause of the problem is that this is an "all-in-one" type page where the form to add the record is on the same page as the table to display. I suspect that something is needed to force the refresh.
The page:
| <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
| <ui:composition xmlns="http://www.w3.org/1999/xhtml"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:a="https://ajax4jsf.dev.java.net/ajax"
| xmlns:rich="http://richfaces.ajax4jsf.org/rich"
| template="layout/template.xhtml">
| <ui:define name="body">
| <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>
| <h:form id="person" styleClass="edit">
| <rich:panel>
| <f:facet name="header">Create Person</f:facet>
| <s:decorate id="firstnameDecoration" template="layout/edit.xhtml">
| <ui:define name="label">Firstname</ui:define>
| <h:inputText id="firstname" value="#{personHome.instance.firstname}"/>
| </s:decorate>
| <s:decorate id="surnameDecoration" template="layout/edit.xhtml">
| <ui:define name="label">Surname</ui:define>
| <h:inputText id="surname" value="#{personHome.instance.surname}"/>
| </s:decorate>
| <s:decorate id="cityDecoration" template="layout/edit.xhtml">
| <ui:define name="label">City</ui:define>
| <h:selectOneMenu id="city" value="#{personHome.instance.city}" style="width:250px;">
| <s:selectItems value="#{cityList.resultList}" var="city"
| noSelectionLabel="Please Select..." label="#{city.cityname}"/>
| <s:convertEntity />
| </h:selectOneMenu>
| </s:decorate>
| <div style="clear:both">
| <span class="required">*</span>
| required fields
| </div>
| </rich:panel>
| <div class="actionButtons">
| <h:commandButton id="save" value="Save"
| action="#{personHome.persist}" rendered="#{!personHome.managed}"/>
| </div>
| </h:form>
| <rich:dataTable var="city" value="#{cityList.resultList}"
| rowClasses="rvgRowOne,rvgRowTwo" id="cityTable">
| <h:column>
| <f:facet name="header">City</f:facet>
| #{city.cityname}
| </h:column>
| <h:column>
| <f:facet name="header">people</f:facet>
| <ui:repeat var="person" value="#{city.persons}">
| <h:outputText value="#{person.firstname} #{person.surname}"/>
| <br/>
| </ui:repeat>
| </h:column>
| </rich:dataTable>
| </ui:define>
| </ui:composition>
|
The page has no pages.xml entries or associated page.xml file. The persist action returns to the current page. I would have thought that as the dataTable is re-rendered, that the List of Persons would be refreshed; however it isn't.
And I have changed the PersonHome object from what Seam generated to remove the PersonHome from the conversation so that the same page can be reused:
| package com.seamtest;
|
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Transactional;
| import org.jboss.seam.contexts.Contexts;
| import org.jboss.seam.framework.EntityHome;
|
| @Name("personHome")
| public class PersonHome extends EntityHome<Person> {
|
| public void setPersonPersonid(Long id) {
| setId(id);
| }
|
| public Long getPersonPersonid() {
| return (Long) getId();
| }
|
| @Override
| protected Person createInstance() {
| Person person = new Person();
| return person;
| }
|
| public Person getDefinedInstance() {
| return isIdDefined() ? getInstance() : null;
| }
|
| @Override
| @Transactional
| public String persist() {
| String status = super.persist();
| Contexts.removeFromAllContexts("personHome");
| return status;
| }
|
| }
|
The Person entity is unchanged from Seam-Gen. It contains only firstname, surname and City. I have changed the City entity to store a java.util.List of Persons rather than a set:
| package com.seamtest;
| // Generated Apr 16, 2007 6:03:07 PM by Hibernate Tools 3.2.0.b9
|
| import java.util.ArrayList;
| import java.util.List;
|
| import javax.persistence.CascadeType;
| import javax.persistence.Column;
| import javax.persistence.Entity;
| import javax.persistence.FetchType;
| import javax.persistence.Id;
| import javax.persistence.JoinColumn;
| import javax.persistence.ManyToOne;
| import javax.persistence.OneToMany;
| import javax.persistence.Table;
|
| import org.hibernate.validator.NotNull;
|
| /**
| * City generated by hbm2java
| */
| @Entity
| @Table(name = "CITY", catalog = "SEAMTEST")
| public class City implements java.io.Serializable {
|
| private long cityid;
| private String cityname;
| // private Set<Person> persons = new HashSet<Person>(0);
| private List<Person> persons = new ArrayList<Person>(0);
|
| public City() {
| }
|
| public City(long cityid) {
| this.cityid = cityid;
| }
| public City(long cityid, String cityname,
| List<Person> persons) {
| this.cityid = cityid;
| this.cityname = cityname;
| this.persons = persons;
| }
|
| @Id
| @Column(name = "CITYID", unique = true, nullable = false)
| @NotNull
| public long getCityid() {
| return this.cityid;
| }
|
| public void setCityid(long cityid) {
| this.cityid = cityid;
| }
|
| @Column(name = "CITYNAME")
| public String getCityname() {
| return this.cityname;
| }
|
| public void setCityname(String cityname) {
| this.cityname = cityname;
| }
| @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "city")
| public List<Person> getPersons() {
| return this.persons;
| }
|
| public void setPersons(List<Person> persons) {
| this.persons = persons;
| }
|
| }
|
|
Happy to email a stripped down project if it would help.
Thanks,
Damian.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043635#4043635
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043635
19 years
[JBoss jBPM] - Re: JBPM Integration
by estaub
Sebastien,
I'm a relative newbie, so I can only help so much.
anonymous wrote : If i want to create a workflow for entity E, do i have to store the id of each instance in the jbpm's context of the process instance in order to do the link between my application and jbpm process ?
Yes, that's the general approach
anonymous wrote : If my application have its own entities for (User, Group, Tasks, Rights ...)
| How do i link with same entities of jbpm ?
|
The identify module is well-isolated and designed to be replaced with whatever you need. See the userguide and javadocs.
anonymous wrote : Business has changed and i have added/removed some states to the process defintion. When deploying a new process definition, a new version is created.
| What happen to the objects (Ids) that where already in the workflow ?
|
They continue to use the old version of the process definition. Old versions are retained in the database for that reason.
anonymous wrote : Do i have to do an sql patch procedure to move my objects already in the workflow to a consistent state according to the new prcocess definition ?
|
Only if you don't want them to continue using the old version.
-Ed Staub
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043634#4043634
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043634
19 years