Fixed memory leak (not unbinding resources from the transaction).

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10619 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gary Spencer
2008-09-01 20:30:28 +00:00
parent 6ffd1a1554
commit bb14b54697

View File

@@ -484,11 +484,23 @@ public class NodeMonitor extends TransactionListenerAdapter
m_eventQueue.addEvent( nodeEvent);
// Unbind the resource from the transaction
AlfrescoTransactionSupport.unbindResource(FileSysNodeEvent);
// Check for a secondary event
nodeEvent = (NodeEvent) AlfrescoTransactionSupport.getResource(FileSysNodeEvent2);
if ( nodeEvent != null)
if ( nodeEvent != null) {
// Queue the secondary event
m_eventQueue.addEvent( nodeEvent);
// Unbind the resource from the transaction
AlfrescoTransactionSupport.unbindResource(FileSysNodeEvent2);
}
}
}
@@ -515,13 +527,16 @@ public class NodeMonitor extends TransactionListenerAdapter
try
{
// Wait for an event to process
final NodeEvent nodeEvent = m_eventQueue.removeEvent();
// DEBUG
if ( logger.isDebugEnabled())
logger.debug("Processing event " + nodeEvent);
// Check for a shutdown
if ( m_shutdown == true)
continue;
@@ -530,6 +545,7 @@ public class NodeMonitor extends TransactionListenerAdapter
public Object execute() throws Throwable
{
// Process the event
if (nodeEvent == null)
{
return null;
@@ -558,12 +574,15 @@ public class NodeMonitor extends TransactionListenerAdapter
processLockNode(( LockNodeEvent) nodeEvent);
}
// Done
return null;
}
};
// Execute in a read-only transaction
m_transService.getRetryingTransactionHelper().doInTransaction(processEventCallback, true, true);
}
catch ( InterruptedException ex)