[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1840) Serious nasty problem with ManagedEntityIdentityInterceptor
by Przemyslaw Jaskierski (JIRA)
Serious nasty problem with ManagedEntityIdentityInterceptor
-----------------------------------------------------------
Key: JBSEAM-1840
URL: http://jira.jboss.com/jira/browse/JBSEAM-1840
Project: JBoss Seam
Issue Type: Bug
Components: Core
Environment: pure Tomcat 6.0.13 + Hibernate 3.2.4, Seam-managed non-JTA Hibernate transactions, Seam.2.CVS.20.08.2007
Reporter: Przemyslaw Jaskierski
Priority: Critical
First of all, please do not underestimate problem in this report. It's a tough one, and definitely not a malfunction on my side. This disclaimer is because as a developer I know what a PR without a testcase is - but please bear with me. I've already spent ssooo much time on this issue that my co-workers will shoot my head off :(:(:(. I've tried to modify Seam examples to demonstrate it to you, but gave up due to problems with hibernate2 (not working Tomcat deployment), Booking (cannot log into it on AS) (BTW I understand that it's a BETA, just reporting)... It's 100% reproducible in my application, but I'm not allowed to share it :(:(:(.
I have a wizard-like, long-running conversation driven by a jpdl pageflow (flushMode=MANUAL). There is a couple of Conversation-scoped Seam components that backs this wizard. I have some @Entity and List<@Entity> fields (pure Hibernate Annotations, no JPA etc.) in some of them.
Problem is that ManagedEntityIdentityInterceptor overwrites valid values of these fields with NULL or ArrayList<NULL> values from time to time. It's quite discrete, and I manged to discover this behavior after a huge amount of time only because I've found this:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=112335
and
http://jira.jboss.com/jira/browse/JBSEAM-1814.
Note that in my situation there is no DataModel-related stuff involved, access to these fields is driven by simple get/setters.
There is another strange thing. On Seam debug page I enter my conversation scope and list all pojos. There is, for example, "pojoName" and "pojoName.listName" components listed (I have only pojoName component registered with @Name, but looks like it's some kind of Seam optimization). As long as I enter/exit inspection of pojoName component, it's listName preserves its content as expected. But after clicking "pojoName.listName": 1st time it shows it's content, but after entering pojoName and pojoName.listName after this, this list is replaced by [null, null, null etc.] values. No, I don't do anything unusual there, it's a simple plain getter.
I think it's not only limited to view-accessed EL-resolved entities, because even my @In components get nullyfied fields (even during the same unit of work, when doing some complex cross-component processing in a single http request). Non-@Entity fields are left untouched.
After looking into ManagedEntityIdentityInterceptor code, I changed my fields to TRANSIENT (to be skipped by ignore(Field) method) and this made everything working OK, like expected. Of course having transient fields is not necessary what you want from you pojos, besides I think that it's a serious problem in ManagedEntityIdentityInterceptor that will ruin some nights of other developer if left unresolved.
I will gladly test eventual fixes against my codebase.
--
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
15 years, 8 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1918) Asyncronous methods called from an asyncronously executing methoed will not be invoke asyncronously
by Chris Rudd (JIRA)
Asyncronous methods called from an asyncronously executing methoed will not be invoke asyncronously
---------------------------------------------------------------------------------------------------
Key: JBSEAM-1918
URL: http://jira.jboss.com/jira/browse/JBSEAM-1918
Project: JBoss Seam
Issue Type: Bug
Components: Async
Affects Versions: 2.0.0.BETA1
Reporter: Chris Rudd
Currently the AsyncronousInterceptor triggers off of
Contexts.getEventContext().isSet(AbstractDispatcher.EXECUTING_ASYNCHRONOUS_CALL)
to determine if this invocation was from the asyncronous dispatcher. This works fine, except under the conditions where the asyncronously executed method calls another @asyncronous methd. In that case the Event context alreadt contains the AbstractDispatcher.EXECUTING_ASYNCHRONOUS_CALL marked and the execution is done immedialty instead of being scheduled.
I belive a simple resolution would be to have the AsyncronousInterceptor clear the AbstractDispatcher.EXECUTING_ASYNCHRONOUS_CALL before proceeding with the exection, but should only be done if the method in question is an @Asycnronous method. This would be to elimiate possible removal from other components that are called during the process of invoking the asyncronous method (ie injection, security, etc).
Here is me proposed change :
AsyncronousInterceptor.java line 24
@AroundInvoke
public Object aroundInvoke(InvocationContext invocation) throws Exception
{
boolean scheduleAsync = invocation.getMethod().isAnnotationPresent(Asynchronous.class) &&
!Contexts.getEventContext().isSet(AbstractDispatcher.EXECUTING_ASYNCHRONOUS_CALL);
if (scheduleAsync)
{
Dispatcher dispatcher = AbstractDispatcher.instance();
if (dispatcher==null)
{
throw new IllegalStateException("org.jboss.seam.async.dispatcher is not installed in components.xml");
}
Object timer = dispatcher.scheduleInvocation( invocation, getComponent() );
//if the method returns a Timer, return it to the client
return timer!=null && invocation.getMethod().getReturnType().isAssignableFrom( timer.getClass() ) ? timer : null;
}
+ else if( invocation.getMethod().isAnnotationPresent(Asynchronous.class) )
+ {
+ // Clear the async flag so that any async methods called by this invocation will execute asyncronously
+ Contexts.getEventContext().remove( AbstractDispatcher.EXECUTING_ASYNCHRONOUS_CALL );
+ return invocation.proceed();
+ }
else
{
return invocation.proceed();
}
}
--
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
15 years, 8 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3507) Allow for navigation rules to take effect before the view is displayed
by Stuart Douglas (JIRA)
Allow for navigation rules to take effect before the view is displayed
----------------------------------------------------------------------
Key: JBSEAM-3507
URL: https://jira.jboss.org/jira/browse/JBSEAM-3507
Project: Seam
Issue Type: Feature Request
Components: Core
Affects Versions: 2.1.0.CR1
Reporter: Stuart Douglas
Allow the developer the specify navigation rules that are evaluated before the view is rendered.
For example, say we do not want logged in users to be able to view the login page, we cannot do this:
<navigation>
<rule if="#{identity.loggedIn}">
<redirect view-id="/main.xhtml"/>
</rule>
</navigation>
Instead you must either use a page action that contains the navigation logic, or specify a dummy page action such as ''.toString()
and use this action as the from-action in your navigation rules. I propose we add an 'immediate' attribute to the navigation attribute that
specifies that this action is evaluated before page actions are run.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 8 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3978) Implement MockNavigationHandler#handleNavigation() for SeamTest
by Dan Allen (JIRA)
Implement MockNavigationHandler#handleNavigation() for SeamTest
---------------------------------------------------------------
Key: JBSEAM-3978
URL: https://jira.jboss.org/jira/browse/JBSEAM-3978
Project: Seam
Issue Type: Feature Request
Components: Core
Affects Versions: 2.1.1.GA
Reporter: Dan Allen
Provide an implementation for the MockNavigationHandler#handleNavigation() so that it is possible to verify that navigation rules fired from a SeamTest.
new FacesRequest("/book.xhtml", id) {
...
@Override
protected void invokeApplication()
{
invokeAction("#{hotelBooking.setBookingDetails}");
}
@Override
protected void renderResponse()
{
assert getRenderedViewId().equals("/confirm.xhtml");
assert Manager.instance().isLongRunningConversation();
}
}.run();
Obviously there are still going to be limitations. The focus needs to be on covering 80% of the cases where you just need to be sure that the navigation matched. Intricate chaining that follows an action likely won't be supported.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 8 months