summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2008-12-31 14:34:37 -0500
committerBernard Normier <bernard@zeroc.com>2008-12-31 14:34:37 -0500
commita0dfb6ad783f35c1b0cad78b9cdae077b57d6de3 (patch)
tree31fd8eb1d67cce0091b3f1757da55b2114af9363 /java
parentMerge branch 'R3_3_branch' of ssh://git/home/git/ice into R3_3_branch (diff)
downloadice-a0dfb6ad783f35c1b0cad78b9cdae077b57d6de3.tar.bz2
ice-a0dfb6ad783f35c1b0cad78b9cdae077b57d6de3.tar.xz
ice-a0dfb6ad783f35c1b0cad78b9cdae077b57d6de3.zip
Fixed bug #3232 (Freeze transactional evictor leaks)
Diffstat (limited to 'java')
-rw-r--r--java/src/Freeze/TransactionI.java9
-rw-r--r--java/src/Freeze/TransactionalEvictorI.java10
-rw-r--r--java/test/Freeze/evictor/AccountI.java9
3 files changed, 24 insertions, 4 deletions
diff --git a/java/src/Freeze/TransactionI.java b/java/src/Freeze/TransactionI.java
index b1d0a807048..e05eab4c663 100644
--- a/java/src/Freeze/TransactionI.java
+++ b/java/src/Freeze/TransactionI.java
@@ -222,7 +222,14 @@ class TransactionI implements Transaction
{
if(_postCompletionCallback != null)
{
- _postCompletionCallback.postCompletion(committed, deadlock);
+ try
+ {
+ _postCompletionCallback.postCompletion(committed, deadlock);
+ }
+ finally
+ {
+ _postCompletionCallback = null;
+ }
}
}
diff --git a/java/src/Freeze/TransactionalEvictorI.java b/java/src/Freeze/TransactionalEvictorI.java
index 6d44f055ea3..26623346c53 100644
--- a/java/src/Freeze/TransactionalEvictorI.java
+++ b/java/src/Freeze/TransactionalEvictorI.java
@@ -252,6 +252,16 @@ class TransactionalEvictorI extends EvictorI implements TransactionalEvictor
{
if(_deactivateController.deactivate())
{
+ synchronized(this)
+ {
+ //
+ // Set the evictor size to zero, meaning that we will evict
+ // everything possible.
+ //
+ _evictorSize = 0;
+ evict();
+ }
+
try
{
closeDbEnv();
diff --git a/java/test/Freeze/evictor/AccountI.java b/java/test/Freeze/evictor/AccountI.java
index 8df7057eeaa..949d77c3b42 100644
--- a/java/test/Freeze/evictor/AccountI.java
+++ b/java/test/Freeze/evictor/AccountI.java
@@ -81,7 +81,6 @@ public class AccountI extends Test.Account
notify();
}
-
public synchronized void run()
{
if(_response == false && _exception == null)
@@ -129,8 +128,7 @@ public class AccountI extends Test.Account
ResponseThread thread = new ResponseThread();
thread.setDaemon(true);
- thread.start();
-
+
test(_evictor.getCurrentTransaction() != null);
try
@@ -140,6 +138,9 @@ public class AccountI extends Test.Account
}
catch(Ice.UserException e)
{
+ thread.start();
+ Thread.yield();
+
//
// Need to rollback here -- "rollback on user exception" does not work
// when the dispatch commits before it gets any response!
@@ -150,6 +151,8 @@ public class AccountI extends Test.Account
return;
}
+ thread.start();
+ Thread.yield();
thread.response();
}