[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2544) Exception handling for javax.persistence.OptimisticLockException fails the second time
by Christian Bauer (JIRA)
Exception handling for javax.persistence.OptimisticLockException fails the second time
--------------------------------------------------------------------------------------
Key: JBSEAM-2544
URL: http://jira.jboss.com/jira/browse/JBSEAM-2544
Project: JBoss Seam
Issue Type: Bug
Affects Versions: 2.0.1.CR2
Reporter: Christian Bauer
Priority: Blocker
Install the wiki, run it in dev profile.
<exception class="javax.persistence.OptimisticLockException">
<end-conversation/>
<!-- TODO: This fails randomly, it works only once and then we don't get the message anymore?! -->
<redirect view-id="/message.xhtml">
<message severity="WARN">#{messages['lacewiki.msg.OptimisticLockError']}</message>
</redirect>
</exception>
Generate this exception by editing directory 'BBB' in two browser tabs, click Update in one of them, then click Update in the other.
If you are lucky, you will now be on the message page with a proper error message. If you don't have a message, that's the bug.
If you get a message, try again and repeat the concurrent update procedure. It will fail at some point, I needed no more than three attempts. Occasionally I get this exception (always doing the same clicks!):
javax.el.ELException: /message.xhtml: Property 'handledException' not found on type org.jboss.seam.Namespace
com.sun.facelets.compiler.TextInstruction.write(TextInstruction.java:48)
Once you get that exception, it will never work again and you will always get this exception (I think).
There are several open issues related to exception handling and message passing, this probably duplicates them. My guess is that we have a serious race condition somewhere in the exception handling code.
--
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
16 years, 8 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2803) In specific cases, a closed entitymanager is injected by seam, resulting in illegalstateexceptions
by Indrek Altpere (JIRA)
In specific cases, a closed entitymanager is injected by seam, resulting in illegalstateexceptions
--------------------------------------------------------------------------------------------------
Key: JBSEAM-2803
URL: http://jira.jboss.com/jira/browse/JBSEAM-2803
Project: JBoss Seam
Issue Type: Bug
Components: Framework
Affects Versions: 2.1.0.A1
Environment: Glassfish v2ur1, Icefaces 1.7.0
Reporter: Indrek Altpere
EntityManager is put to event Scope for better memory usage and GC.
Class that tries to use the entitymanager is itself in conversation scope, and this specific behavior occurs after icefaces file upload.
Injected em is closed and throws IllegalStateException for every function used (as it should when it's closed).
I dug around the persistence namespace/package and found once place that could explain it.
src/main/org/jboss/seam/persistence/ManagedPersistenceContext.java
line 225 to 229
if (entityManager!=null)
{
entityManager.close();
}
As seen, entityManager is closed but since getEntityManager() function only creates new entitymanager when entityMAnager is null and does not check for entityManager being closed, the closed entitymanager gets passed around.
I added entityManager = null; after the entityManager.close(); line so that the getEntityManager() would correctly return new entitymanager after old one was closed and recompiled the latest sources.
It seemed to fix this issue, no more errors, em injected to the conversation scope class is not closed one anymore :)
There may be some other things related to this like JBSEAM-2666 but I'm not entirely sure about it.
--
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
16 years, 8 months