Hibernate version:
3
Mapping documents:
NA
Code between sessionFactory.openSession() and session.close():
NA
Full stack trace of any exception that occurs:
No exception
Name and version of the database you are using:
NA
The generated SQL (show_sql=true):
NA
Debug level Hibernate log excerpt:
NA
My question is about the code below, specifically the bolded line. If this is coming from the UI (Controller) how did the UI avoid LazyInitializationException (LE) on the associations between requests (meaning if the user updated the cateogry list)?
Is it the norm to have the form use th HB bean and if so how do you avoid LE?
example code:
Code:
public class ManageAuction {
ItemDAO itemDAO = new ItemDAO();
PaymentDAO paymentDAO = new PaymentDAO();
public void endAuction(Item item) {
// Reattach item
[b]itemDAO.makePersistent(item);[/b]
// Set winning bid
Bid winningBid = itemDAO.getMaxBid( item.getId() );
item.setSuccessfulBid(winningBid);
item.setBuyer( winningBid.getBidder() );
// Charge seller
Payment payment = new Payment(item);
paymentDAO.makePersistent(payment);
// Notify seller and winner
...
}
...
}