[JBoss Seam] - How to end converstation when user doesn't cooperate?
by tynor
Seam 1.2.1-GA, seam-gen derived infrastructure (Home classes, etc.)
My recent discovery of the need to use MANUAL flushing on a certain page has gotten me to pay more attention to conversational lifespan than I had in earlier phases of our app's development. I am now worried about the following use case / bug which I can easily produce in my app (NOTE: this is on a page that is not using MANUAL flushing - it's orthogonal to the flush-mode):
User selects "Edit Widget" which instantiates a new instance of WidgetHome and loads Widget #1 into its getInstance(). page.xml for this page sets up the conversation:
<begin-conversation join="true"/>
As long as the user ends his interaction with the form in one of the "expected" ways (Save, Remove, Cancel), he will trigger a corresponding <end-conversation> specified either in the navigation rules in page.xml, or via a propagation="end" in the xhtml.
However: what happens if the user exits the form by some other means (e.g. a link off the global menu.xhtml, a bookmarked link, etc.). The conversation will not end. Let's say that menu link gets him back to the page where he can click "Create Widget". Normally, this would create a new WidgetHome and a brand spanking fresh createInstance() call would create a new Widget instance. But since I'm still in the old conversation, I end up reusing the old WidgetHome from the "improperly" exited form page -- and my "Create Widget" screen is populated with the Widget #1 I was visiting before I so rudely left the page with a Menu link instead of a Cancel.
I can't find any provision in the Seam navigation model for blanket ending a conversation. For the global navigation menu, perhaps I could add propogate="end" to all the s:link's (I'd have to think that through - I'm not sure I'd _always_ want to do that). but that doesn't help with other cases (a bookmarked link, the user typing a URL into the address bar, etc.).
The only think I can think of is to create some sort of AJAX-y event that I can call from an onunload Javascript event to end the conversation no matter why the user is navigating away from the page. This feels dirty. It can't be how Seam intends conversations to work...
Help?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078065#4078065
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4078065
18Â years, 8Â months
[Persistence, JBoss/CMP, Hibernate, Database] - Hibernate 3, MySQL and nullable timestamp
by sarbogast
I've got an issue with Hibernate 3 hbm2ddl and my MySQL 5.0 database
One of my entities has a field that is mapped onto a TIMESTAMP column. This field can be null but in MySQL, a TIMESTAMP can only be null if specified in the column declaration. From MySQL documentation:
anonymous wrote :
| TIMESTAMP columns are NOT NULL by default, cannot contain NULL values, and assigning NULL assigns the current timestamp. However, a TIMESTAMP column can be allowed to contain NULL by declaring it with the NULL attribute. In this case, the default value also becomes NULL unless overridden with a DEFAULT clause that specifies a different default value.
|
Unfortunately, the following mapping:
| <hibernate-mapping default-cascade="none">
| <class name="com.thalys.opalys.domain.IncidentImpl" table="INCIDENT" dynamic-insert="false" dynamic-update="false">
| <!--...-->
| <property name="endDate" >
| <column name="END_DATE" not-null="false" unique="false" sql-type="TIMESTAMP"/>
| <type name="org.joda.time.contrib.hibernate.PersistentLocalDate">
| </type>
| </property>
| <!--...-->
| </class>
| </hibernate-mapping>
|
Produces the following CREATE TABLE when hdm2ddl runs:
| create table INCIDENT (
| --...
| END_DATE TIMESTAMP,
| --...
| ) type=InnoDB;
|
Did I miss something or is it a bug?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078058#4078058
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4078058
18Â years, 8Â months