[JBoss Seam] - TransactionCompletionEvent and @Asynchronous
by cpopetz
I have:
Events.instance().raiseTransactionSuccessEvent("doLongWorkAfterTxIsDone");
and
@Observer("doLongWorkAfterTxIsDone")
public void doWork() {
aSLSB.anAsyncMethod();
}
where anAsyncMethod() is a method marked @Aysnchronous. (I'd mark the observer itself as @Asynchronous, but that gets ignored.) However, anAsyncMethod() isn't called asynchronously, because TransactionCompletionEvent is an AsynchronousEvent, and seam disallows spawning one asynchronous call from another. But in my case, the CMT tx is committing (and the event is being fired) upon return of a SFSB method that is executed within a web request, i.e. very synchronously as far as the browser is concerned.
I'm not completely clear on the logic behind disallowing chained async calls, so this may be misguided. But it seems to me that Asynchronous.execute() should only set EXECUTING_ASYNCHRONOUS_CALL if it indeed sets up a new set of contexts. That would allow the above code to work. Of course, it might break something else :)
I have a workaround, which is to raise another asynchronous event from the observer of the transactionComplete event, but that's rather convoluted.
Thanks for any input,
-Clint
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113740#4113740
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113740
18 years, 4 months
[JBoss Seam] - Re: Scope of EntityManager
by dapeng
anonymous wrote : The way your have everything configured Seam should never be attempting to create a transaction before a conversation is created.
|
Can you elaborate on this statement. I already posted my configuration. I enabled the seam transaction management and using a layered architecture a spring-based application layer. The entry point into my application is for example a list page, which uses a query to show a list of results. The action executing the query has a page scope, because I don't need to start any conversation at that timepoint.
According to my understanding, a non-longrunning should be started upon every request. The error I get is not reproducable. But once I was able to cathc it in my debug session. There I got a null entity manager in the line 59 o f the class SeamManagedEntityManagerFactory.
EntityManager em = (EntityManager) component.getInstance(persistenceContextName);
The only explanation I have is that somehow the conversation context is not yet activated at that time, so the line 1865 in the class Component is not executed.
result = component.newInstance();
But why sometimes the conversation is not activated for an incoming request, is not clear for me. It seems the conversation context will only be activated after the restore view phase in the seamphase listener. Could there be some cases, where only the render view phase is invoked without the restore view phase, so that conversation context was no initialized?
Any hint will be appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113739#4113739
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113739
18 years, 4 months
[JBoss Portal] - Configuring drag and drop on a per region basis
by J4S0N
Hello,
I've seen questions similar to mine already posted, but I don't think anyone has asked this question specifically: Can I enable/disable DnD at the region level for a given layout?
For example, I want to inject portlets A and B into region one. I want to disable DnD on region one so that other portlets may NOT be dragged into it, and portlets A and B may NOT be dragged out of it. However I also have regions 2 and 3 which contain portlets C and D respectively, and I would like to be able to drag these portlets between these two regions.
Is this supported? Or do you recommend a different approach for the fixed region where it's content is not in a fact a portlet, but just some kind of simple markup fragment?
I'm using the bundled distribution of JBoss Portal 2.6.2. Any suggestions would be appreciated.
Jason.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113727#4113727
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113727
18 years, 4 months