r6940 - dumbhippo/trunk/server/src/com/dumbhippo/server/impl



Author: walters
Date: 2007-11-28 15:14:09 -0600 (Wed, 28 Nov 2007)
New Revision: 6940

Modified:
   dumbhippo/trunk/server/src/com/dumbhippo/server/impl/HttpMethodsBean.java
Log:
Make previous commit actually work.



Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/impl/HttpMethodsBean.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/impl/HttpMethodsBean.java	2007-11-28 20:12:03 UTC (rev 6939)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/impl/HttpMethodsBean.java	2007-11-28 21:14:09 UTC (rev 6940)
@@ -1370,7 +1370,7 @@
 		final Interpreter bsh = makeInterpreter(pw);
 		pw.flush();
 		
-		Callable<Object> execution = new Callable<Object>() {
+		final Callable<Object> execution = new Callable<Object>() {
 			public Object call() throws Exception {
 				return bsh.eval(command);
 			}
@@ -1379,8 +1379,14 @@
 		try {
 			Object result;
 			if (transaction) {
-				result = TxUtils.runInTransaction(execution);
-				DataService.getModel().initializeReadWriteSession(SystemViewpoint.getInstance());
+				Callable<Object> dmCallable = new Callable<Object>() {
+					public Object call() throws Exception {
+						DataService.getModel().initializeReadWriteSession(SystemViewpoint.getInstance());
+						return execution.call();
+					}
+				};
+				result = TxUtils.runInTransaction(dmCallable);
+
 			} else {
 				result = execution.call();
 			}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]