Package org.apache.stonehenge.stocktrader.dal

Examples of org.apache.stonehenge.stocktrader.dal.DAOException


      closeOrderStat.setBigDecimal(3, order.getPrice());
      closeOrderStat.setInt(4, order.getOrderID());
      closeOrderStat.executeUpdate();

    } catch (SQLException e) {
      throw new DAOException("", e);

    } finally {
      if (closeOrderStat != null) {
        try {
          closeOrderStat.close();
View Full Code Here


            logger.debug("", e);
          }
        }
      }
    } catch (SQLException e) {
      throw new DAOException("", e);
    } finally {
      if (insertOrder != null) {
        try {
          insertOrder.close();
        } catch (SQLException e) {
View Full Code Here

      sqlConnection
          .setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
    } catch (SQLException e) {
      e.printStackTrace();
      logger.debug("", e);
      throw new DAOException(
          "Exception was thrown during the start of transaction", e);
    }
  }
View Full Code Here

    try {
      sqlConnection.commit();
      sqlConnection.setAutoCommit(true);
      sqlConnection.setTransactionIsolation(previousTransactionIsolation);
    } catch (SQLException e) {
      throw new DAOException(
          "Exception is thrown during the commit of transaction", e);
    }
  }
View Full Code Here

    try {
      sqlConnection.rollback();
      sqlConnection.setAutoCommit(true);
      sqlConnection.setTransactionIsolation(previousTransactionIsolation);
    } catch (SQLException e) {
      throw new DAOException(
          "Exception is thrown during the rollback of transaction", e);

    }
  }
View Full Code Here

  public void close() throws DAOException {
    try {
      sqlConnection.close();
    } catch (SQLException e) {
      throw new DAOException("", e);
    }
  }
View Full Code Here

    if (StockTraderUtility.ORDER_TYPE_SELL.equals(orderType)) {
      // CHECKME holding is the argument
      holding = orderDAO.getHolding(holdingID);
      if (holding == null) {
        throw new DAOException("No holding entry found for HoldingID<"
            + holdingID + ">");
      }
      order = orderDAO.createOrder(userID, holding.getQuoteID(),
          StockTraderUtility.ORDER_TYPE_SELL, holding.getQuantity(),
          holdingID);

    } else if (StockTraderUtility.ORDER_TYPE_SELL_ENHANCED
        .equals(orderType)) {
      holding = orderDAO.getHolding(holdingID);
      if (holding == null) {
        throw new DAOException("No holding entry found for HoldingID<"
            + holdingID + ">");
      }
      if (quantity > holding.getQuantity()) {
        order = orderDAO.createOrder(userID, holding.getQuoteID(),
            StockTraderUtility.ORDER_TYPE_SELL, holding
View Full Code Here

                        logger.debug("", e);
                    }
                }
            }
        } catch (SQLException e) {
            throw new DAOException("Exception is thrown when selecting the profile id for unique id: " + Id + "and Sts: " + Sts, e);
        } finally {
            if (selectProfileId != null) {
                try {
                    selectProfileId.close();
                } catch (SQLException e) {
View Full Code Here

                        logger.debug("", e);
                    }
                }
            }
        } catch (SQLException e) {
            throw new DAOException("Exception is thrown when selecting the holding entry for order ID :" + orderId, e);
        } finally {
            if (selectHoldingLockStat != null) {
                try {
                    selectHoldingLockStat.close();
                } catch (SQLException e) {
View Full Code Here

                    }
                }
            }
        } catch (SQLException e) {
            logger.debug("", e);
            throw new DAOException("Exception is thrown when selecting the holding entry for userID :" + userId + " and orderID :" + holdingID, e);

        } finally {
            if (selectHoldingNoLockStat != null) {
                try {
                    selectHoldingNoLockStat.close();
View Full Code Here

TOP

Related Classes of org.apache.stonehenge.stocktrader.dal.DAOException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.