[JBoss Seam] - Stale Data until redeploy
by sjmenden
I posted in the EJB 3.0 forum without much success, so I am hoping this forum can help me, as the users are more active.
I am having a horrible time with stale data. In my seam app, I create jobs then list the jobs, and I can click on a job to edit it. However, when I edit a job, the changes absolutely refuse to show up in the listing of jobs, the listing of jobs only shows the state of when I initially created a job, and NO changes.
This is really driving me mad and I am not sure how to fix it.
I am using MySQL InnoDB, and everything shows up as correct in the database. All the data is current and right, however in my view, all the data is old. Is there some cache I need to disable, or someway to can ensure the data for listing my jobs is not stale.
I've tried several things like giving the Query hints and disabling 2nd level cache in the persistence.xml, but nothing works.
| @Name("viewJobs")
| @Stateful
| @Scope(ScopeType.SESSION)
| public class ViewJobsBean implements ViewJobs {
|
| @Logger
| private Log log;
|
| @DataModel
| private List<Job> jobs;
|
| @DataModelSelection
| private Job job;
|
| @PersistenceContext(type=EXTENDED)
| private EntityManager em;
|
| public String view() {
| Map parameters = new HashMap();
| StringBuffer queryString = new StringBuffer();
|
| queryString.append("from Job");
|
| Query query = em.createQuery(queryString.toString());
| // query.setHint("org.hibernate.cacheable", new Boolean(false));
| // query.setHint("org.hibernate.cacheMode", CacheMode.IGNORE);
| // query.setHint("org.hibernate.flushMode", FlushMode.ALWAYS);
|
| jobs = (List<Job>) query.getResultList();
| return "viewJobs";
| }
|
| public void delete(){
| em.remove(job);
| view();
| }
|
| public void refresh() {
| view();
| }
|
| @Destroy @Remove
| public void destroy() {}
| }
|
| <persistence>
| <persistence-unit name="entityManager">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:/jobsDatasource</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
| <!--<property name="hibernate.hbm2ddl.auto" value="update"/>-->
| <property name="hibernate.show_sql" value="true"/>
| <property name="hibernate.format_sql" value="true" />
| <!--<property name="hibernate.cache.use_second_level_cache" value="false" />-->
|
| <!--<property name="hibernate.jdbc.batch_size" value="0" />-->
| <property name="jboss.entity.manager.factory.jndi.name" value="java:/jobsEntityManagerFactory"/>
| </properties>
| </persistence-unit>
| </persistence>
|
|
The only way to Can get the changes to the jobs to show up is if I redeploy the web app. Am I missing something?
Help with this is greatly appreciated
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975895#3975895
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975895
19 years, 7 months
[JBoss Seam] - Re: Using JBPM
by germit
hello,
what have you done to get pageflows work within a portlet? we have a few jsf portlets, but pageflows do not work.
we are using SeamExtendedManagedPersistencePortletPhaseListener and on startup everything works fine (no exception) and the pageflow stuff is initialized. we have a start method in the session bean with the @begin tag. the pageflow seems to work, but the next page (login.xhtml) in our example is not rendered. instead the browser comes up with a download box and you can choose where to save the page login.xhtml.
i can't find any example with jsf portlets and pageflows. IPC is another point i try to find information about.
thanks for any help... regards...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975889#3975889
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975889
19 years, 7 months