mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -484,11 +484,23 @@ public class NodeMonitor extends TransactionListenerAdapter
|
|||||||
|
|
||||||
m_eventQueue.addEvent( nodeEvent);
|
m_eventQueue.addEvent( nodeEvent);
|
||||||
|
|
||||||
|
// Unbind the resource from the transaction
|
||||||
|
|
||||||
|
AlfrescoTransactionSupport.unbindResource(FileSysNodeEvent);
|
||||||
|
|
||||||
// Check for a secondary event
|
// Check for a secondary event
|
||||||
|
|
||||||
nodeEvent = (NodeEvent) AlfrescoTransactionSupport.getResource(FileSysNodeEvent2);
|
nodeEvent = (NodeEvent) AlfrescoTransactionSupport.getResource(FileSysNodeEvent2);
|
||||||
if ( nodeEvent != null)
|
if ( nodeEvent != null) {
|
||||||
|
|
||||||
|
// Queue the secondary event
|
||||||
|
|
||||||
m_eventQueue.addEvent( nodeEvent);
|
m_eventQueue.addEvent( nodeEvent);
|
||||||
|
|
||||||
|
// Unbind the resource from the transaction
|
||||||
|
|
||||||
|
AlfrescoTransactionSupport.unbindResource(FileSysNodeEvent2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -515,13 +527,16 @@ public class NodeMonitor extends TransactionListenerAdapter
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Wait for an event to process
|
// Wait for an event to process
|
||||||
|
|
||||||
final NodeEvent nodeEvent = m_eventQueue.removeEvent();
|
final NodeEvent nodeEvent = m_eventQueue.removeEvent();
|
||||||
|
|
||||||
// DEBUG
|
// DEBUG
|
||||||
|
|
||||||
if ( logger.isDebugEnabled())
|
if ( logger.isDebugEnabled())
|
||||||
logger.debug("Processing event " + nodeEvent);
|
logger.debug("Processing event " + nodeEvent);
|
||||||
|
|
||||||
// Check for a shutdown
|
// Check for a shutdown
|
||||||
|
|
||||||
if ( m_shutdown == true)
|
if ( m_shutdown == true)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -530,6 +545,7 @@ public class NodeMonitor extends TransactionListenerAdapter
|
|||||||
public Object execute() throws Throwable
|
public Object execute() throws Throwable
|
||||||
{
|
{
|
||||||
// Process the event
|
// Process the event
|
||||||
|
|
||||||
if (nodeEvent == null)
|
if (nodeEvent == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
@@ -558,12 +574,15 @@ public class NodeMonitor extends TransactionListenerAdapter
|
|||||||
|
|
||||||
processLockNode(( LockNodeEvent) nodeEvent);
|
processLockNode(( LockNodeEvent) nodeEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Done
|
// Done
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Execute in a read-only transaction
|
// Execute in a read-only transaction
|
||||||
|
|
||||||
m_transService.getRetryingTransactionHelper().doInTransaction(processEventCallback, true, true);
|
m_transService.getRetryingTransactionHelper().doInTransaction(processEventCallback, true, true);
|
||||||
}
|
}
|
||||||
catch ( InterruptedException ex)
|
catch ( InterruptedException ex)
|
||||||
|
Reference in New Issue
Block a user