[jboss-user] [JBoss Seam] - Re: Weird async/timer related error, collection not processe

rdewell do-not-reply at jboss.com
Mon Oct 30 21:24:04 EST 2006

Code, sure thing:

  | @Local
  | public interface OrderProcessor {
  |    @Asynchronous
  |    public void process(@Duration long startInMS, String id);
  | }

  | @Stateless
  | @Name("OrderProcessor")
  | @Interceptors(SeamInterceptor.class)
  | public class OrderProcessorImpl implements OrderProcessor, Serializable {
  | 	private static final long serialVersionUID = -8591335166721681758L;
  | 	private static final Log LOG = LogFactory.getLog(OrderProcessorImpl.class);
  | 	@In(value="bright", create=true)
  | 	private transient EntityManager em;
  | 	public void process(long initialStartMS, String id) {
  | 		LOG.info("Processing transaction: " + id);
  | 		AcquisitionTransaction acquisition = em.find(AcquisitionTransaction.class, id);
  | 		OrderUtil.process(em, acquisition);
  | 		LOG.info("Finished processing txn: " + id + " = " + acquisition.getLifecycle());
  | 	}
  | }

So obviously there's a bunch of work going on in the static OrderUtil.process method.  OrderProcessor.process(String id) is called from a JSF action method on another stateless Seam component.

If I leave "@Asynchronous" on the interface, and therefore give it to the timer service, it blows up with the flush error, rolls back, etc.

If I comment out the @Asynchronous on the interface, and therefore just execute this inline with the JSF request, then everything works just as it has been (fine).  Transaction commits, no errors, etc.

Since all I'm doing to make it work / not work is comment / uncomment @Asynchronous, it's almost like there's a difference of environment going on between a Seam / facelets request lifecycle, and a timer environment wtr to hibernate?  

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981934#3981934

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981934

More information about the jboss-user mailing list