Code: Select all
@Transactional("blTransactionManager")
private void changeOrderStatus(Order order,OrderService orderService)
{
order.setStatus(OrderStatus.SUBMITTED);
try {
orderService.save(order, true);
System.out.println("order saved");
} catch (PricingException e) {
System.out.println("Exception occured while saving order");
e.printStackTrace();
}
}
Also I found that when I am trying to inject OrderService into the class, it isn't being injected. I added the package of the class in core module applicationContext.xml file using <context:component-scan>
This is the error I am getting
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.broadleafcommerce.core.order.domain.OrderImpl.addedOfferCodes, could not initialize proxy - no Session