[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-5565) Memory leak is possible if changes for audited entities are outside of transaction

Eugene Goroschenya (JIRA) noreply at atlassian.com
Thu Sep 30 13:06:57 EDT 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5565?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eugene Goroschenya updated HHH-5565:
------------------------------------

    Attachment: HHH-5565_(corrected).patch

The previous [^HHH-5565.patch] is incorrect because of WARN log message 
{{log.warn("Couldn't create revision for entity " + entityName + " because transaction is not active.");}} 
even in case of non-audited entry if transaction is inactive.
See [^HHH-5565_(corrected).patch]

> Memory leak is possible if changes for audited entities are outside of transaction
> ----------------------------------------------------------------------------------
>
>                 Key: HHH-5565
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5565
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: envers
>    Affects Versions: 3.3.1
>         Environment: hibernate-core-3.3.1.GA.jar, jboss-envers-1.2.1-hibernate-3.3.jar
>            Reporter: Eugene Goroschenya
>         Attachments: HHH-5565.patch, HHH-5565_(corrected).patch
>
>
> Envers always collects changes for audited objects in global (global per sessionFactory instance) application map (auditConfiguration.auditSyncManager.auditSyncs<Transaction, AuditSync>) even if transaction is inactive.
> It leads to memory leak in application if there were changes (insert/update/delete) for versioned objects outside of transaction (transaction.isActive() == false) because in this case transaction is not committed where collected changes for current transaction are removed from global map.
> Possible solution is patch Envers to check if transaction is active (AuditEventListener in onPostInsert/onPostUpdate/onPostDeleteonCollectionAction methods) before starting collect changes for audited object.
> Skip collecting (to prevent memory leak) if transaction is inactive and log WARN message to indicate problem ("Couldn't create revision for entity ${entityName} because transaction is not active.")

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list