Author: clebert.suconic(a)jboss.com
Date: 2011-11-02 10:41:27 -0400 (Wed, 02 Nov 2011)
New Revision: 11631
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PagingManagerImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PagingStoreImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
Log:
Fixing file leak that will affect windows on paging
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PagingManagerImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PagingManagerImpl.java 2011-11-02
04:15:29 UTC (rev 11630)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PagingManagerImpl.java 2011-11-02
14:41:27 UTC (rev 11631)
@@ -114,8 +114,17 @@
for (PagingStore store : reloadedStores)
{
- store.start();
- stores.put(store.getStoreName(), store);
+ PagingStore oldStore = stores.get(store.getStoreName());
+ if (oldStore != null)
+ {
+ oldStore.stop();
+ oldStore.start();
+ }
+ else
+ {
+ store.start();
+ stores.put(store.getStoreName(), store);
+ }
}
}
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PagingStoreImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PagingStoreImpl.java 2011-11-02
04:15:29 UTC (rev 11630)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PagingStoreImpl.java 2011-11-02
14:41:27 UTC (rev 11631)
@@ -426,6 +426,10 @@
{
currentPageId = 0;
+ if (currentPage != null)
+ {
+ currentPage.close();
+ }
currentPage = null;
List<String> files = fileFactory.listFiles("page");
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-11-02
04:15:29 UTC (rev 11630)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-11-02
14:41:27 UTC (rev 11631)
@@ -317,6 +317,7 @@
public synchronized void start() throws Exception
{
+ log.debug("Starting server " + this);
OperationContextImpl.clearContext();
try