Buggy code:
public class BuyFundAction extends Action { private FormBeanFactory < BuyFundForm > formBeanFactory = FormBeanFactory . getInstance ( BuyFundForm . class ) ; private FundDAO fundDAO ; private CustomerDAO customerDAO ; private TransactionDAO transactionDAO ; private FundPriceHistoryDAO fundPriceHistoryDAO ; public BuyFundAction ( Model model ) { } public String getName ( ) { } public String perform ( HttpServletRequest request ) { List < String > errors = new ArrayList < String > ( ) ; List < String > successes = new ArrayList < String > ( ) ; request . setAttribute ( "errors" , errors ) ; request . setAttribute ( "successes" , successes ) ; try { HttpSession session = request . getSession ( ) ; CustomerBean customer = ( ( CustomerBean ) ( session . getAttribute ( "customer" ) ) ) ; if ( customer == null ) { errors . add ( "session<seq2seq4repair_space>expired" ) ; return "index.do" ; } <START_BUG> CustomerBean latestCustomer = customerDAO . read ( customer ) ; <END_BUG> request . setAttribute ( "balance" , ConvertUtil . convertAmountLongToDouble ( latestCustomer . getBalance ( ) ) ) ; FundBean [ ] fundsWithoutPrice = fundDAO . getAllFunds ( ) ; FundPriceDetailBean [ ] funds = new FundPriceDetailBean [ fundsWithoutPrice . length ] ; Date latestDay = fundPriceHistoryDAO . findLatestDate ( ) ; if ( fundsWithoutPrice != null ) { for ( int i = 0 ; i < ( fundsWithoutPrice . length ) ; i ++ ) { FundPriceDetailBean fundPrice = new FundPriceDetailBean ( ) ; fundPrice . setFund_id ( fundsWithoutPrice [ i ] . getFund_id ( ) ) ; fundPrice . setName ( fundsWithoutPrice [ i ] . getName ( ) ) ; fundPrice . setSymbol ( fundsWithoutPrice [ i ] . getSymbol ( ) ) ; if ( latestDay != null ) { FundPriceHistoryBean priceHistory = fundPriceHistoryDAO . read ( fundsWithoutPrice [ i ] . getFund_id ( ) , latestDay ) ; if ( priceHistory == null ) { fundPrice . setPrice_date ( null ) ; fundPrice . setPrice ( 0 ) ; } else { fundPrice . setPrice_date ( latestDay ) ; fundPrice . setPrice ( priceHistory . getPrice ( ) ) ; } } else { fundPrice . setPrice_date ( null ) ; fundPrice . setPrice ( 0 ) ; } funds [ i ] = fundPrice ; } } request . setAttribute ( "funds" , funds ) ; BuyFundForm form = formBeanFactory . create ( request ) ; request . setAttribute ( "form" , form ) ; System . out . println ( form . getFundname ( ) ) ; if ( ! ( form . isPresent ( ) ) ) { return "buyFund.jsp" ; } errors . addAll ( form . getValidationErrors ( ) ) ; if ( ( errors . size ( ) ) != 0 ) { return "buyFund.jsp" ; } FundBean fund = fundDAO . getFundByName ( form . getFundname ( ) ) ; if ( fund == null ) { errors . add ( "No<seq2seq4repair_space>such<seq2seq4repair_space>fund." ) ; return "buyFund.jsp" ; } customerDAO . updateBalance ( customer . getCustomer_id ( ) , form . getFundAmountAsDouble ( ) ) ; TransactionBean transaction = new TransactionBean ( ) ; transaction . setCustomer_id ( customer . getCustomer_id ( ) ) ; transaction . setAmount ( ConvertUtil . convertAmountDoubleToLong ( form . getFundAmountAsDouble ( ) ) ) ; transaction . setFund_id ( fund . getFund_id ( ) ) ; transaction . setIs_complete ( false ) ; transaction . setIs_success ( false ) ; transaction . setTransaction_date ( new Date ( ) ) ; transaction . setTrasaction_type ( "buy" ) ; transactionDAO . createAutoIncrement ( transaction ) ; successes . add ( "Your<seq2seq4repair_space>transaction<seq2seq4repair_space>is<seq2seq4repair_space>in<seq2seq4repair_space>process<seq2seq4repair_space>!" ) ; } catch ( RollbackException e ) { errors . add ( e . getMessage ( ) ) ; return "buyFund.jsp" ; } catch ( FormBeanException e ) { errors . add ( e . getMessage ( ) ) ; return "buyFund.jsp" ; } catch ( AmountOutOfBoundException e ) { errors . add ( e . getMessage ( ) ) ; return "buyFund.jsp" ; } return "manage.jsp" ; } }

Fix:
CustomerBean latestCustomer = customerDAO . read ( customer . getCustomer_id ( ) ) ;