I have fixed it. It won't show the assignment anymore. But the fix works only in IE and Firefox, opera users will be able to edit the assignment, but they will get error on save (but not the ugly exception - nice error page is work to be done :))

Hmm.. not much to do about opera if I can't force it to reload page on back button.

-Matej

Matej Knopp wrote:
Btw. What do you think would be correct action?

Showing user a message, that assignment has been deleted,

or

Being able to save the assignment, without throwing any exception?

(or showing user a message, that assignment has been deleted and afterwares go to the assingment and allow to save it)

-Matej

Michael Jouravlev wrote:

Cool, very nice app!

You said that any button could be pressed, so I did ;-))

* My Assignments, select any assignment and click "show"
* Click "Delete"
* Hit Back, the data is still there
* While still on "show" page hit Refresh. Hmm, seems like the data was
not deleted.
* Click "Save" and get an exception:

=== cut here ===
wicket.WicketRuntimeException: Method public abstract void
wicket.markup.html.link.ILinkListener.onLinkClicked() of interface
java.lang.reflect.Method threw an exception
at wicket.protocol.http.WebRequestCycle.invokeInterface(WebRequestCycle.java:506) at wicket.protocol.http.WebRequestCycle.invokeInterface(WebRequestCycle.java:562) at wicket.protocol.http.WebRequestCycle.callComponentListener(WebRequestCycle.java:420) at wicket.protocol.http.WebRequestCycle.parseRequest(WebRequestCycle.java:129)
    at wicket.RequestCycle.request(RequestCycle.java:403)
    at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:304)
...
Caused by: java.lang.reflect.InvocationTargetException
    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:585)
at wicket.protocol.http.WebRequestCycle.invokeInterface(WebRequestCycle.java:497)
    ... 71 more
Caused by: org.springframework.orm.hibernate3.HibernateSystemException:
Batch update returned unexpected row count from update: 0 actual row
count: 0 expected: 1; nested exception is
org.hibernate.StaleStateException: Batch update returned unexpected
row count from update: 0 actual row count: 0 expected: 1
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:656) at org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:586) at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:496) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:435) at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:258) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:67) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
    at $Proxy9.saveAssignmentWithLastModified(Unknown Source)
at esz.app.sponsor.assignments.pages.ViewAssignmentPage$10.onClick(ViewAssignmentPage.java:248)
    at wicket.markup.html.link.Link.onLinkClicked(Link.java:181)
    ... 76 more
Caused by: org.hibernate.StaleStateException: Batch update returned
unexpected row count from update: 0 actual row count: 0 expected: 1
at org.hibernate.jdbc.BatchingBatcher.checkRowCount(BatchingBatcher.java:92) at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:78) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:57) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:172) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:226) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:137) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
    at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:678)
    at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:309)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86) at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:488)
    ... 84 more
=== cut here ===

This is exactly why I think that default Wicket approach with page
versioning and restoring model when Back button is pressed is faulted.
It brings too many issues. I think that the page should be
synchronized with model not the other way around. But... well, as long
as I do have an option of doing things in Wicket my way (and I do have
this option), I am not going to critique much ;)

Michael.


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to