[
http://jira.jboss.com/jira/browse/JBSEAM-1423?page=comments#action_12371913 ]
Andy Gibson commented on JBSEAM-1423:
-------------------------------------
Here's the test plan for my app to test the business conversation IDs.
It is also available in the file TestPlan.txt as part of the zip files I have attached.
-------------------------------------------------------------------------
The test app consists of a list of books, with each book having an edit page, and a view
page. Edit pages are navigated using PageFlows, while the view page is just a single
conversational page, with a back button that ends the conversation. The book view page is
conversational just to demonstrate the problems. I thought it would provide a more
complete testing app if it used conversational pages, with and without a pageflow.
Oddly enough, I cannot get the "conversation ID in use" exception to happen, and
as I recall, under 2.0 Beta, it happens only under certain conditions, and seems to be far
rarer, perhaps because the conversation Id conversion exception described below kicks in
before it gets to the conversation ID in use error.
However, the "bookConv:id" error often happens under multiple circumstances. In
these cases, it seems like it forgot it has a book bean in the conversation and is trying
to create a new one.
"bookConv" is the name of the conversation with a parameter called
'bookId' and a value of #{book.id}. It is used in the bookEdit and bookView pages
to pass the book id.
1) Restart the app
2) Click on "Lord of the Rings" to view the Lord of the rings details
3) Click on the "books" link at the top of the page (no conversation
propagation)
4) In the conversation switcher, click on the "View Lord of the Rings"
conversation
5) ERROR - /bookView.xhtml: For input string: "bookConv:1"
1) Optionally - restart the app'
2) Click on the edit link for JBoss Seam
3) Click on the Books link at the top of the page to go back to the list
4) In the conversation switcher, click on the "Edit Book JBoss Seam" link
5) ERROR - /bookEdit.xhtml: For input string: "bookConv:3"
We can use the conversation switcher if we are not on the main book edit page.
1) Optionally - restart the app'
2) Click on the edit link for JBoss Seam
3) Click on the Books link at the top of the page to go back to the list
4) Now click on the edit link for JBoss Seam again]
5) It picks up the existing conversation based on the ID and continues it
6) Click the add button to add an author
7) Click the books link at the top to go to the book list
9) In the conversation switcher, click on the "Add author to JBoss Seam" link
10) No Error, oddly enough
11) To demonstrate that we are in the pageflow and everything is ok, select J.R.R.
Toklien, and we go back to the Book edit page and tolkien has been added to the list of
authors for JBoss seam.
What is interesting about this, is that the actual error occurs (from the log) at :
14:26:26,828 DEBUG [BookEditBean] FACTORY - generating book from id = bookConv:3
14:26:26,828 WARN [Interpolator] exception interpolating string: Edit Book #{book.title}
javax.ejb.EJBTransactionRolledbackException: For input string: "bookConv:3"
I'm wondering why it is re-executing the factory method for the book when the book is
already in the conversation? Interestingly enough, the authorList.xhtml page which we use
to select the author also uses #{book.title} in its page description so one would have
thought the error would occur there also, and yet it never executes the book factory
method.
"Conversation Id Already In Use" exception with
<conversation> tag in pages.xml
-------------------------------------------------------------------------------
Key: JBSEAM-1423
URL:
http://jira.jboss.com/jira/browse/JBSEAM-1423
Project: JBoss Seam
Issue Type: Bug
Components: Core
Affects Versions: 1.2.1.GA
Environment: JBoss 4.05, Seam 1.2.1GA, Exadel studio, windows XP, 1gig ram,
running on local copy of JBoss AS (non-clustered)
Reporter: Andy Gibson
Assigned To: Gavin King
Priority: Critical
Fix For: 2.0.0.CR1
Attachments: BookStoreTest_seam2Beta.z01, BookStoreTest_seam2Beta.z02,
BookStoreTest_seam2Beta.z03, BookStoreTest_seam2Beta.z04, BookStoreTest_seam2Beta.zip,
BookTest1.zip, BookTest2.zip, BookTest3.zip, BookTest4.zip
When using the <conversation> tag in pages.xml to specify the conversation ID and
parameter name for explicit conversation IDs, I get a "Conversation ID is already in
use exception" . I have a test application and a test script which I have included
below, but is also in the main application in file BookTest/Readme.txt.
I also admit that this is new stuff, with no documentation for it, so I could be using it
totally wrong, and there is no bug
------------------ Included Text from BooktTest\ReadMe.txt -----------
Here is an application that demonstrates the problems with the conversation Id in use
issue.It's a cut down version of my little test application, and now simply consists
of a list of books, and the ability to edit those books. There is a minimal pageflow in
there which just takes you to another page, and then back to the book edit page.
I've modified it to connect to hsqldb, and included an import.sql script to populate
with the test data used. I'm aiming for simple CRUD with pageflow on the book edit
page and RESTful URLs which is why I have the bookId as a parameter, and use a book
factory. The idea is to have a conversation on the 'search' page (which in this
app, just lists the books), and then another conversation on the edit page. The idea being
is that the edit page can be reused stand-alone and doesn't mess with the current
conversation that invokes the page.
I only mention this in case you think "WTF is he doing that for!"
Test Cases :
Here I've listed a couple of cases which can be re-produced when starting the
application from scratch with a clean slate (i.e. restarting the app and clearing all
conversations).
Also note that the switcher is based on the one from the pdf docs, and seems fairly hit
and miss on how it works. Destroying usually just switches conversations, sometimes
you'll destroy one, and
Case 1)
Launch the app
Click Lord of the Rings to edit it
Click Search Books on the switcher
Click "Edit Book Lord of the Rings" in the switcher, and it blows up
(conversation in use exception)
Case 2)
Launch the app
Click "Lord of the Rings" to edit it
Click the "Home" link on the top header (link has propagation = none)
Click "JBoss Seam" to edit that book
Click "Lord of the Rings" in the Switcher at the bottom (it works ok)
Click "Search books" in the switcher
Click "Lord of the Rings" in the switcher at the bottom (it fails with a
conversation in use exception)
This demonstrates that things work ok if you are already on the bookEdit page, but not
when you move to another conversation
Case 3)
Launch the app
Click "Lord of the rings" to edit it
Click the "search Books" on the switcher
Click "Jboss Seam" to edit it
On the edit page, click TestNav button to go to the next page in the pageflow
In the switch click "Lord of the rings" to switch to the LOTR Conversation (it
fails with a conversation in use exception)
This demonstrates that switching conversations fails if you are in a similar pageflow, in
a long conversation etc..
For whatever reason though, the button on the extra page will take you back to the book
edit page, which was broken on my original application with the same error. However, it
appears to work here.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira