-
1. Re: Updates don't work after 10 minutes
mana.hotmana76.gmail.com Oct 14, 2011 8:46 AM (in response to christophe.carvalho)You should notice in log if session or conversation timeout happens.
-
2. Re: Updates don't work after 10 minutes
christophe.carvalho Oct 14, 2011 9:01 AM (in response to christophe.carvalho)Ok i'll try...
I just unable the sql log and when i don't wait 10 minutes there are
Hibernate: update
in the log but if i wait more than 10 minutes noHibernate: update
:(... -
3. Re: Updates don't work after 10 minutes
christophe.carvalho Oct 14, 2011 11:57 AM (in response to christophe.carvalho)Passivation of ejb seems to be the cause of my problem...
Only my ejb stateful session beans seem to be concerned. In log, after 6 minutes, there is the passivation of my ejb and then calling entityHome.update() in this bean doesn't work...
Any ideas ?
Regards.
-
4. Re: Updates don't work after 10 minutes
christophe.carvalho Oct 14, 2011 2:28 PM (in response to christophe.carvalho)So, i add @Cache(org.jboss.ejb3.cache.NoPassivationCache.class) (which prevent passivation) to my SFSB and updates works correctly even after 10 minutes...
But disabling
passivation
is not recommended i think... So what am i doing wrong ? Is it a configuration problem ? -
5. Re: Updates don't work after 10 minutes
mana.hotmana76.gmail.com Oct 15, 2011 5:14 PM (in response to christophe.carvalho)Could you show your code?
-
6. Re: Updates don't work after 10 minutes
christophe.carvalho Oct 20, 2011 9:34 AM (in response to christophe.carvalho)Sorry for the delay and thanks for your help...
Here is my SFSB code :
@Stateful @Scope(ScopeType.CONVERSATION) @Name("matriceLot") //@Cache(org.jboss.ejb3.cache.NoPassivationCache.class) public class MatriceLotBean implements MatriceLot { ... @In(value="entityManager") EntityManager em; @Out(required = false) private NumericCrossTable<LigneMatricePlanning, CDTColumn, Float> matriceLotCDT = null; List(Assignable) lignes; ... public void updateCrossDataTableValues() { if(matriceLotCDT != null){ for(Line<LigneMatricePlanning, Float> line : matriceLotCDT.getLineList()){ Assignable assignableRef = (Assignable) line.getLineDesignation(); // TODO : to deal with passivation problem Assignable assignable = null; for (Assignable assignableTmp : lignes) { if (assignableTmp.equals(assignableRef)) { assignable = assignableTmp; break; } } if ((assignable != null) && assignable.getId() > 0) { for (Column<CDTColumn> column : matriceLotCDT.getColumnList()){ Cell<Float> cell = matriceLotCDT.getCell(line.getLineId(),column.getColumnId()); if(matriceLotRealisee){ assignable.setChargeEffective(column.getColumnDesignation().getDate(),cell.getCellValue(), modeSaisieActivite); } else { assignable.setChargeInitiale(column.getColumnDesignation().getDate(),cell.getCellValue(), modeSaisieActivite); } } } } .... em.flush(); } } }
But it's clearly a passivation problem, i have enabled the ManagedEntityInterceptor (core:init distributable
true
) and it works if my entitys (the valuesassignable
above) aredirect
properties of my SFSB.My problem now is that my entitys are stored in an object (NumericCrossTable) and if i access my entitys directly from that object after passivation they are detached...That why i add the following
bad
workaround :Assignable assignableRef = (Assignable) line.getLineDesignation(); // TODO : to deal with passivation problem Assignable assignable = null; for (Assignable assignableTmp : lignes) { if (assignableTmp.equals(assignableRef)) { assignable = assignableTmp; break; } }
For information, the class
NumericCrossTable
implements Serializable.Is there a way to prevent my entitys from being detached even if they are not
direct
properties of my SFSB ?Sorry for my bad english ;).
Regards.