geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jb...@apache.org
Subject svn commit: r816734 - in /geronimo/sandbox/jbohn/daytrader-bp/modules: core/src/main/java/org/apache/geronimo/samples/daytrader/core/direct/TradeJDBCDirect.java web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeConfigServlet.java
Date Fri, 18 Sep 2009 18:22:05 GMT
Author: jbohn
Date: Fri Sep 18 18:22:04 2009
New Revision: 816734

URL: http://svn.apache.org/viewvc?rev=816734&view=rev
Log:
get price updates working again

Modified:
    geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/direct/TradeJDBCDirect.java
    geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeConfigServlet.java

Modified: geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/direct/TradeJDBCDirect.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/direct/TradeJDBCDirect.java?rev=816734&r1=816733&r2=816734&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/direct/TradeJDBCDirect.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp/modules/core/src/main/java/org/apache/geronimo/samples/daytrader/core/direct/TradeJDBCDirect.java
Fri Sep 18 18:22:04 2009
@@ -225,6 +225,10 @@
             releaseConn(conn);
         }
 
+        //after the purchase or sell of a stock, update the stocks volume and
+        // price
+        updateQuotePriceVolume(symbol, TradeConfig.getRandomPriceChangeFactor(), quantity);
+
         return orderData;
     }
 
@@ -295,6 +299,11 @@
             releaseConn(conn);
         }
 
+        if (!(orderData.getOrderStatus().equalsIgnoreCase("cancelled")))
+            //after the purchase or sell of a stock, update the stocks volume
+            // and price
+            updateQuotePriceVolume(orderData.getSymbol(), TradeConfig.getRandomPriceChangeFactor(),
orderData.getQuantity());
+
         return orderData;
     }
 

Modified: geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeConfigServlet.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeConfigServlet.java?rev=816734&r1=816733&r2=816734&view=diff
==============================================================================
--- geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeConfigServlet.java
(original)
+++ geronimo/sandbox/jbohn/daytrader-bp/modules/web/src/main/java/org/apache/geronimo/samples/daytrader/web/TradeConfigServlet.java
Fri Sep 18 18:22:04 2009
@@ -73,7 +73,7 @@
                 TradeServices tradeServices = ServletUtilities.getTradeServices();
 		try
 		{
-			tradeServices.resetTrade(false);
+			runStatsData = tradeServices.resetTrade(false);
 			
 			req.setAttribute("runStatsData", runStatsData);
 			req.setAttribute("tradeConfig", currentConfig);



Mime
View raw message