[jboss-user] [JBoss Seam] - long running transaction

grego@spiekerpoint.com do-not-reply at jboss.com
Wed Mar 21 16:31:59 EDT 2007


Hi

I'm writing an application that processes a huge amount of data. I want to kick this off in the middle of the night with a timer service inside of the app server so that the slsb can chew on the problem set for a few hours and shove data into the database when needed.

Now, the issue is the transaction times out. It's a bad idea to extend the transaction timeout to hours, so I figured I would bracket the database work by opening and closing the transaction (since I know where the delimiters are).

Ok, so Seam isn't letting me do things like:

		
  | while(moreDataToProcess) {
  |     someProcessing();
  | 
  |     entityManager.getTransaction().begin();
  |     ...
  |     entityManager.persist(obj);
  |     entityManager.getTransaction().commit();
  | 
  |     otherProcessing();
  | }
  | 

giving an error of:
ERROR [org.jboss.ejb.txtimer.TimerImpl] Error invoking ejbTimeout: javax.ejb.EJBException: java.lang.IllegalStateException: Illegal to call this method from injected, managed EntityManage

There must be a way to tell Seam to quick trying to control the transaction inside of a particular slsb (or for the whole app server) - but for the life of me I can't find documentation or posts on how to do that.

Any pointers to docs or posts, or comments on how to approach this?

Thanks,
Greg

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

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



More information about the jboss-user mailing list