[JBoss Seam] - DataModel changes not reflected in view [possible newbie ign
by giannidoe
I'm using a session-scope stateful session bean to hold search results in a DataModel - in a similar manner to the booking example.
I first populate the DataModel by performing an entity query, if I then modify and persist one of the entities from the search results, return to the search page and perform the same search again the changes to the entity are not reflected in the view, my dataTable still displays the original values even though logging shows that the DataModel has been correctly updated.
@Stateful
| @Name("websiteSearch")
| @Scope(ScopeType.SESSION)
|
| @DataModel("websites")
| private List<Website> websites;
|
| @RequestParameter
| String letter;
|
| public void findDomainByLetter() {
| websites = entityManager.createNamedQuery("Website.findByDomainLetter")
| .setParameter("domainName", letter.toLowerCase() + "%")
| .setMaxResults(pageSize)
| .setFirstResult(page * pageSize)
| .getResultList();
| }
<ui:repeat value="#{websiteSearch.alphabet}" var="letter">
| <s:link value="#{letter}" action="#{websiteSearch.findDomainByLetter}">
| <f:param name="letter" value="#{letter}"/>
| </s:link>ÃÂ ÃÂÃÂ
| </ui:repeat>
|
| <h:dataTable id="websites" value="#{websites}" var="site" rendered="#{websites.rowCount>0}">
| <h:column>
| <f:facet name="header"><h:outputText value="#{msgs['website.host-name']}"/></f:facet>
| <s:link action="#{siteManager.editSite}">
| <h:outputText value="#{site.domain.name}"/>
| <f:param name="id" value="#{site.id}"/>
| </s:link>
| </h:column>
| ..snip
| </h:dataTable>
If I then perform a different search and subsequently repeat the original search the changes are then reflected in the view.
Could this be some kind of view caching issue or maybe a poor grasp of the jsf lifecycle ..?
I'd appreciate some suggestions.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119044#4119044
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119044
18 years, 3 months
[JBoss jBPM] - Re: jBPM Console - login failed
by rodosa
You should also insert data in the JBPM_ID_GROUP & JBPM_ID_MEMBERSHIP. For example,
| INSERT INTO JBPM_ID_GROUP VALUES (1,'G','sales','organisation',NULL);
| INSERT INTO JBPM_ID_GROUP VALUES (2,'G','admin','security-role',NULL);
| INSERT INTO JBPM_ID_GROUP VALUES (3,'G','user','security-role',NULL);
| INSERT INTO JBPM_ID_GROUP VALUES (4,'G','hr','organisation',NULL);
| INSERT INTO JBPM_ID_GROUP VALUES (5,'G','manager','security-role',NULL);
|
| INSERT INTO JBPM_ID_USER VALUES (1,'U','user','user(a)sample.domain','user');
| INSERT INTO JBPM_ID_USER VALUES (2,'U','manager','manager(a)sample.domain','manager');
| INSERT INTO JBPM_ID_USER VALUES (3,'U','admin','admin(a)sample.domain','admin');
| INSERT INTO JBPM_ID_USER VALUES (4,'U','shipper','shipper(a)sample.domain','shipper');
|
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES (1,'M',NULL,NULL,2,4);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES (2,'M',NULL,NULL,3,4);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES (3,'M',NULL,NULL,4,4);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES (4,'M',NULL,NULL,4,3);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES (5,'M',NULL,NULL,1,3);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES (6,'M',NULL,NULL,2,3);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES (7,'M',NULL,NULL,3,3);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES (8,'M',NULL,NULL,3,2);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES (9,'M',NULL,NULL,2,2);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES (10,'M',NULL,NULL,2,5);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES (11,'M',NULL,'boss',2,1);
| INSERT INTO JBPM_ID_MEMBERSHIP VALUES (12,'M',NULL,NULL,1,1);
|
|
This is a part of an script that is located in the data directory of Jboss server...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119042#4119042
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119042
18 years, 3 months
[EJB 3.0] - PersistenceContext shared between Ejbs' (CMB)
by sraick
Hi all,
I have an ear application running on JBoss 4.2.1 GA that contains 2 EJB Stateless jar's. I have only one persistence unit define in the persistence.xml of only one of the jar/META-INF.
All is container-managed, so JTA is used and I don't need to manage transaction. The isolation level of my DB is read_commited.
In the first EJB jar, the EntityManager is injected (@PersistenceContext).
In the second one, the Entity manager is retrieved by Spring and JNDI (but should be the same as the one used in the first EJB) as follow:
| <bean id="jpaTemplate" class="org.springframework.orm.jpa.JpaTemplate">
| <property name="entityManager" ref="entityManagerBPM" />
| </bean>
| <jee:jndi-lookup id="entityManagerBPM" jndi-name="persistence/manager1"/>
|
My problem:
- in the first stateless, I do em.persist(bean);
- in the second one (after the persist) I do a em.find(bean.getClass(), bean.getId());
Sometimes the find cannot retrieve the bean. I guess that the transaction of the persist caller has not been commited.
If you had any idea on how to use the really same instance of the EntityManager between stateless bean (CMB) please let me know about it.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4119037#4119037
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4119037
18 years, 3 months