[JBoss Seam] - Double nested conv. deletes parent's component
by pdpantages
Seam 1.2.1.GA
Hello Forum,
I have run into another oddity with nested conversations, when I try to nest more than 1 deep.
Any ideas on this will be appreciated....
I have conversation stack like this:
[3,2,1] (contains component editorBean3)
[2,1] (contains component tableBean2,dataModel2)
[1] (contains tableBean1,dataModel1)
The editor and table beans are all SFSB, @Conversational, scope
CONVERSATION.
The Seam debugger shows the above objects in the correct
context/conversation after I start the two nested conversations.
Conversation [2] is started by an s:link + propagation="nest".
This link is in a t:dataTable rendered from dataModel1.
Conversation [3] is also started by an s:link + propagation="nest".
The link is in a t:dataTable rendered from dataModel2.
In the above scenario, when I @End conversation [3], Seam
destroys tableBean2. It disappears from the context, but the
dataModle2 is not similarly deleted (verified by Seam debugger).
I was not expecting this; components in conversation[2] should not
be affected by the ending of [3], no?
Notes:
The nested conversations in each case are ended with @End. The @End
action method returns a jsf outcome that returns the browser to the
page from which the "edit" was launched.
I don't see this same behaviour between [1] and [2]. Begining and
Ending nested conversation [2] does not destory or affect tableBean1.
I have 3 facelet pages that are used for the three cases.
I don't have any conversation related directives in my pages.xml for the
corresponding three views.
There are no references to component tableBean2 by EditorBean3 or by
the facelet/page 3.
Conversation [3] is started from page[2]/Conversaion[2] like so. These
s:links are renderd for each row in a t:datatable.
| <s:link
| title="Click to get Alarm details"
| value="Details"
| styleClass="sortLink"
| propagation="nest"
| action="#{eventEditor.showEventDetails}" >
| <f:param name="seqNum" value="#{alarmRow.sequenceNumber}"/>
| <f:param name="ctx" value="servicealarmdetails"/>
| </s:link>
|
Conversation [3] is ended by:
| <s:link
| value="Done"
| styleClass="button"
| onmouseover="this.className='buttonUp'"
| onmouseout="this.className='button'"
| onmousedown="this.className='buttonDown'"
| onmouseup="this.className='buttonUp'"
| action="#{eventEditor.done}">
| </s:link>
|
The editor's done() action just returns a jsfOutcome which returns the browser to page[2]
| @End
| public String done()
| {
| if ( log.isTraceEnabled() )
| log.trace ( traceprefix + "(" + Conversation.instance().getId() + ") done" );
|
| return this.jsfOutcome;
| }
|
I have also noticed the following. I don't know if these are significant or not:
When the browser returns to page[2], the s:links in the table are
rendered with the proper cid, but with lrc=false. The seam debugger
and worksapces both contradict this, showing that cid 2 is still a
long running conversation.
The url on page[2] doesn't look right. Initially like:
http://localhost:8080/client/view/fault/servicealarmdetails.seam?cid=6&lr...
After Beginning then Ending Conversation [3] and returning to the page it looks like:
http://localhost:8080/client/view/fault/servicealarmdetails.seam?cid=7&pa...
I put debug statement in my @Create and @Destory method of the table,
which uses Conversation.getInstance().getId() to print the CID.
I am not certain if the CID is still valid in the destory method; but CID
(3) is printed from in the tableBean2.destory() method.
I.e., I see my log:
...
tableBean2 (2) Create
...
editorBean3 (3) end
...
...
tableBean2 (3) Destroy
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4072249#4072249
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4072249
18Â years, 9Â months
[JBoss jBPM] - problem while deleting processInstance
by iseyfi
Hi,
I am trying to delete a processIntance using GrapSession object. What I have looks like
GraphSession session = context.getGraphSession();
ProcessInstance processInstance = null;
if (session != null) {
processInstance = session.getProcessInstance(processInstanceId);
if (processInstance != null) {
session.deleteProcessInstance(processInstance);
}
}
When I do this i get a hibernate exception.
org.springframework.dao.DataIntegrityViolationException: Hibernate operation: Could not execute JDBC batch update; SQL [delete from JBPM_MODULEINSTANCE where ID_=?]; Cannot delete or update a parent row: a foreign key constraint fails (`forms/jbpm_swimlaneinstance`, CONSTRAINT `FK_SWIMLANEINST_TM` FOREIGN KEY (`TASKMGMTINSTANCE_`) REFERENCES `jbpm_moduleinstance` (`ID_`)); nested exception is java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`forms/jbpm_swimlaneinstance`, CONSTRAINT `FK_SWIMLANEINST_TM` FOREIGN KEY (`TASKMGMTINSTANCE_`) REFERENCES `jbpm_moduleinstance` (`ID_`))
java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`forms/jbpm_swimlaneinstance`, CONSTRAINT `FK_SWIMLANEINST_TM` FOREIGN KEY (`TASKMGMTINSTANCE_`) REFERENCES `jbpm_moduleinstance` (`ID_`))
am I missing something?
thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4072248#4072248
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4072248
18Â years, 9Â months
[JBoss Seam] - Newbie Help. Do I have SEAM deployed?
by birwin
I started fiddling with SEAM (2.0.0BETA1) today, but I don't think I have installed it correctly (Installing on JBoss 4.2.1.GA).
I am unable to display data in my UI (Its a JSP). Each time I load the web page, the input field is empty, but my backing bean has data. The backing bean has a value assigned to its property on instantiation (See the java code below). If I add a "managed-bean" entry to my faces-config.xml, it works fine and the number appears in my input field. I thought I did not need "managed-bean" entries in my faces-config.xml file if I was using SEAM. From my searches on the Internet, it appears that I am not using SEAM, but the plain JSF. I have deployed the Seam JAR file in the WEB_INF/lib directory of my war file. Attached are my faces-config, web.xml, JSP and Java class files.
My java class has the Name and Scope annotations, and I have included the phase-listener entry in my faces-config.xml file in addition to including the listener-class entry in my web.xml file. When I deploy to my JBoss server, it appears SEAM kicks in. I see row after row of "INFO [Component] Component: org.jboss.web.session, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.web.Session" type messages.
Any ideas what I did wrong?
faces-config.xml file:
<faces-config>
<phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
</faces-config>
web.xml file:
<web-app>
<!-- Listeners -->
<!-- Seam -->
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
<!-- JSF -->
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
<!-- Faces Servlet -->
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<taglib-uri>http://java.sun.com/jsf/core</taglib-uri>
<taglib-location>/WEB-INF/jsf_core.tld</taglib-location>
<taglib-uri>http://java.sun.com/jsf/html</taglib-uri>
<taglib-location>/WEB-INF/html_basic.tld</taglib-location>
<taglib-uri>http://java.sun.com/jsp/jstl/core </taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</web-app>
JSP:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:view>
<h:form>
<h:inputText value="#{test.text}" />
</h:form>
</f:view>
Test Java Class:
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
@Scope(ScopeType.CONVERSATION)
@Name("test")
public class Test
{
private String text = "hello";
public String getText()
{
return text;
}
public void setText(String text)
{
this.text = text;
}
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4072245#4072245
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4072245
18Â years, 9Â months
[JBoss Seam] - Sortable columns, the simplest Trinidad way?
by ellenzhao
I want my data table columns to be sortable. I've read this blog entry:
http://pmuir.bleepbleep.org.uk/2007/04/backing-trinidads-datatable-with-s...
But to sort the data set in memory is exactly what I want (There are usually 3~6 sortable columns in a single data table in my application. Fetching data set from a remote database on every sorting click sounds like a horror to me. Complexity of heap-sort is O(N log N)....I cache all the frequently used data sets in static fields in an APPLICATION scoped stateless bean.). Trinidad has that feature but I did not find information about how to use it together with Seam. I looked at the SeamDisc example from the latest CVS there are still questions:
1. Do I have to use ajax4jsf if I only want to use Trinidad's sortable column feature? If not, how should the web.xml, faces-config.xml, and other configuration files look like?
2. Is there any working example which has only Seam + Trinidad + Facelets together?
3. Does this Trinidad thing work with JSF RI 1.2 (the latest JSF reference implementation) or do I have to use MyFaces to make it work?
Any enlightenment would be highly appreciated!
Regards,
Ellen
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4072242#4072242
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4072242
18Â years, 9Â months