|
[picocontainer-scm] [jira] Created: (NANOPERSISTENCE-8) Infinite Loop in or: msg#00095java.picocontainer.cvs
Infinite Loop in org.nanocontainer.persistence.hibernate.SessionComponent ------------------------------------------------------------------------- Key: NANOPERSISTENCE-8 URL: http://jira.codehaus.org/browse/NANOPERSISTENCE-8 Project: NanoContainer Persistence Issue Type: Bug Reporter: Michael Rimov Assigned To: Michael Rimov There's an infinite loop in the code if a hibernate exception is thrown if a hibernate exception is thrown while calling invalidateDelegatedSession() {code} protected void invalidateDelegatedSession() throws HibernateException { if (session != null) { try { session.clear(); session.close(); } catch (HibernateException ex) { throw handleException(ex); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } finally { session = null; } } } {code} handleException does: {code} protected RuntimeException handleException(RuntimeException cause) throws HibernateException { try { invalidateDelegatedSession(); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } catch (RuntimeException e) { // Do nothing, only the original exception should be reported. } return hibernateExceptionHandler.handle(cause); } {code} which starts the loop all over again. I believe it's acceptable to change invalidateDelegatedSession() to {code} /** * Perform actions to dispose "burned" session properly. */ protected void invalidateDelegatedSession() throws HibernateException { if (session != null) { try { session.clear(); session.close(); } finally { session = null; } } } {code} I've got the fixed code in my "NanoPersistence split modules", so if that one gets okayed, I'll check in this fix right away as well. Am I missing anything? -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira <hr/> <p> To unsubscribe from this list please visit: </p> <p> <a href="http://xircles.codehaus.org/manage_email">http://xircles.codehaus.org/manage_email</a>
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [picocontainer-scm] [jira] Updated: (NANOPERSISTENCE-7) Separate Nano-Persistence into multiple projects akin to the rework on NanoContainer., Michael Rimov (JIRA) |
|---|---|
| Next by Date: | [picocontainer-scm] [jira] Created: (NANOPERSISTENCE-9) SessionComponent. Can Mask Hibernate Exceptions if Session was closed due to Exception, Michael Rimov (JIRA) |
| Previous by Thread: | [picocontainer-scm] [picocontainer] [3178] java/nanocontainer-nanowar/trunk/examples/nanowar-jsf-webapp: Fixed POM for standalone packaging., rimovm-yCVjj/EcxBJg9hUCZPvPmw |
| Next by Thread: | [picocontainer-scm] [jira] Created: (NANOPERSISTENCE-9) SessionComponent. Can Mask Hibernate Exceptions if Session was closed due to Exception, Michael Rimov (JIRA) |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |