« Return to Thread: Data loss within Session Script

Re: Data loss within Session Script

by Thomas Manson :: Rate this Message:

Reply to Author | View in Thread

Hi Joe,
 
Here you'll find my project:
 
http://paquerette.com/crf-irp.rar
 
Download,
unzip,
open your eclipse (I'm using europa),
Import the two projects (crf is a webapp project, crf-model a simple java project, linked with J2EE module dependencies)
Edit java build path to set a Java 1.5 or 1.6 JDK, tomcat path too.
 
Run these scripts (UTF8 encoding).
workspaces\crf\crf-irp\Ressources\sql\createDatabase.sql
workspaces\crf\crf-irp\Ressources\sql\insert.sql
 
scripts on a MySQL server 5.
 
It creates a crf-irp database and filled it.
 
Edit crf-irp.properties for MySQL credentials.
 
Finally, edit your c:\windows\system32\drivers\etc\hosts
 
and add
 
127.0.0.1 crf
 
(it's for the g 0 0 gle maps licence work)
 
Add the webapp to a tomcat 5.5,

Run the webapp,
 
browse to http://crf:8080/crf-irp
 
login,
clic on the fist line of the Ext Table,
 
Two windows opens,
on the first tab of the "SAISIE - CRF" window, clic on the button
 
"Ajouter un ticket d'intervention"
 
Quickly fill the form with any data, except the adresse (Rue, Code Postal, Ville), put :
 
92 Avenue des Champs-Elysées,
75008,
Paris
 
Click on Terminée.
 
You should see a box appear in the "Monitor" window, on the left accordion.
 
Now do the same but wait about 7 minutes before hitting the "Terminer" bouton.
 
When about 7 minutes passes (could be less, could be more),
 
You'll see in the logs an exception, and the other window is not updated.(where it should as, it the code I don't check anymore the regulation id, so that mean the script session related to the second page (Monitor) are lost)
 

2008-07-06 21:41:59,656 - DEBUG - http-8080-Processor23 (DefaultRemoter.java:462) - Exec: MonitorInputIntervention.updateInterventionStringField() Object created,  not stored. id=0
2008-07-06 21:41:59,656 - DEBUG - http-8080-Processor23 (InterventionServiceImpl.java:608) - Intervention with id='1' has its field 'complement_adresse' updated with value '1' (line updated = '1')
2008-07-06 21:47:53,875 - DEBUG - http-8080-Processor20 (DefaultWebContext.java:98) - ScriptSession re-sync: 89C120F98A27F1D6C8049022F1DB437B has become 35EC71F68F44160D0022F716808F5F87
2008-07-06 21:47:53,875 - DEBUG - http-8080-Processor20 (DefaultRemoter.java:462) - Exec: MonitorInputIntervention.endOfEditionEvent() Object created,  not stored. id=0
2008-07-06 21:47:53,875 - DEBUG - http-8080-Processor20 (InterventionServiceImpl.java:502) - Intervention with id='1' has its field 'id_etat' updated with value '1' (line updated = '1')
2008-07-06 21:47:53,890 - ERROR - http-8080-Processor20 (DWRUtils.java:55) - RegulationId Not Found
java.lang.Exception: regulationId not found in ScriptSession
 at fr.croixrouge.irp.services.dwr.DWRUtils.getRegulationId(DWRUtils.java:104)
 at fr.croixrouge.irp.services.dwr.DWRUtils.updateRegulationUser(DWRUtils.java:51)
 at fr.croixrouge.irp.services.dwr.monitorInput.MonitorInputInterventionImpl.endOfEditionEvent(MonitorInputInterventionImpl.java:42)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilter.java:34)
 at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:472)
 at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:475)
 at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:323)
 at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52)
 at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101)
 at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:144)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at fr.RS2i.sedna.security.SecurityFilter.doFilter(SecurityFilter.java:165)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
 at java.lang.Thread.run(Thread.java:619)
2008-07-06 21:47:54,156 - DEBUG - http-8080-Processor20 (DefaultRemoter.java:462) - Exec: MonitorInputIntervention.getInterventionTicketList() Object created,  not stored. id=0
2008-07-06 21:47:54,156 - DEBUG - http-8080-Processor20 (InterventionServiceImpl.java:75) - getting internvetion ticket for regulation id='2' with status status='1' from index='0' with limit='5'
2008-07-06 21:47:54,171 - DEBUG - http-8080-Processor20 (DefaultRemoter.java:462) - Exec: MonitorInputIntervention.getInterventionTicketList() Object created,  not stored. id=0
2008-07-06 21:47:54,171 - DEBUG - http-8080-Processor20 (InterventionServiceImpl.java:75) - getting internvetion ticket for regulation id='2' with status status='0' from index='0' with limit='5'
Thanks for your help,
you can contact me on gtalk with same email adress without the 'dev.' part.
Thomas
 
On 7/3/08, Thomas Manson <dev.mansonthomas@...> wrote:
Hi Joe,
 
  I cant sent you the project with instructions.
  There is 2 SQL scripts to run in a mysql database and then run the app.
 
 I'll do that tonight or tomorrow.
 
Thanks,
Thomas.

 
On 7/2/08, Joe Walker <joe@...> wrote:

Hi Thomas,

Sorry about the delay. I'm catching up.
Is the webapp something that I can see failing at all? Does it need an external database?

Joe.



On Sun, Apr 20, 2008 at 4:34 PM, Thomas Manson <dev.mansonthomas@...> wrote:
Hi,
 
I'm having some strange issue with Session Script.
 
 
My webapp is used as follow
  1. welcome screen where you can select something like a chatroom
  2. once selected, two popup windows are opened (dual screen app)
  3. Both make an initial call to set the 'chatroom id' within the script session.
  4. The left window (no reverse ajax) is used to input some data. When the input is ended, an ajax call (the "end call") is made to the server to notify all client right window that something new has been added.
The issue is :
 
1/ If I input something quickly after the two window opening, everything works ok
2/ If I wait some time doing nothing, and then input something, on the "end call", when doing a foreach on my scriptsession (to do reverse ajax) opened on the right window, I can't find the chatroomId.
3/Next to 2/ if I refresh only the left window (input) and do the input again, it works.
 
I think something is wrong with script session handling with two popup.
 
On server side I browse script session of the right window, data in script session seems lost.
But a refresh on the left windows correct the situation (ie : one window set it's id in it's left script session)
Whereas, it would be more logical that all client on right windows refresh their browser to correct the data loss.
 
I'm using DWR3 M1.
 
I'm opening the two popup from the same window, which is handy as a window can call a javascript function of the other window (via the common parent window).
 
Do you think a workaround would be : Select chatroom, navigate to new page, open one window, navigate to a new page, open an other ? (also I loose the handy cross window js call)
 
Or, all my window are implementing the a generic method and I filter the server message on client side (poor solution).
 
 
Thomas.
 



 « Return to Thread: Data loss within Session Script