[jboss-user] [JBoss jBPM] - Re: nothing persisting?

ibivibiv do-not-reply at jboss.com
Wed Apr 29 11:58:33 EDT 2009


So, now that I know that the JTA persistance is not committing, can anyone give me a hint as to the why?  I'll paste my config and a quick example of a MDB that starts a process that never commits to the database.


  | <jbpm-configuration>
  | 
  |   <jbpm-context>
  |     <service name="persistence" factory="org.jbpm.persistence.jta.JtaDbPersistenceServiceFactory" />
  |     <!--<service name="persistence" factory="org.jbpm.persistence.db.DbPersistenceServiceFactory" />-->
  |     <service name="message" factory="org.jbpm.msg.jms.JmsMessageServiceFactory" />
  |     <service name="scheduler" factory="org.jbpm.scheduler.ejbtimer.EntitySchedulerServiceFactory" />
  |     <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
  |     <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
  |     <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
  |   </jbpm-context>
  | 
  |   <!-- use the context class loader -->
  |   <string name="jbpm.classLoader" value="context" />
  | 
  |   <!-- 
  |     Note, that the default job executor needs to be overwritten with a null value. 
  |     In the enterprise configuration there should be no job executor. 
  |     Async messaging is there bound to jms and scheduling to ejb timers.  
  |   -->  
  |   <null name="jbpm.job.executor" />
  | 
  | </jbpm-configuration>
  | 


  | 
  | package com.theplanet.jbpm.messagebeans;
  | 
  | import javax.ejb.ActivationConfigProperty;
  | import javax.ejb.MessageDriven;
  | import javax.ejb.TransactionManagement;
  | import javax.ejb.TransactionManagementType;
  | import javax.ejb.TransactionAttribute;
  | import javax.ejb.TransactionAttributeType;
  | import javax.jms.Message;
  | import javax.jms.TextMessage;
  | import javax.jms.MessageListener;
  | 
  | import org.jbpm.graph.exe.ProcessInstance;
  | import org.jbpm.JbpmConfiguration;
  | import org.jbpm.JbpmContext;
  | 
  | 
  | /**
  |  * Message-Driven Bean implementation class for: ProcessMDB
  |  * 
  |  */
  | @MessageDriven(name = "ProcessMDB", activationConfig = {
  | 		@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
  | 		@ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/ProcessQueue"),
  | 		@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge") })
  | @TransactionManagement(TransactionManagementType.CONTAINER)
  | @TransactionAttribute(TransactionAttributeType.REQUIRED)
  | public class CopyOfProcessMDB implements MessageListener {
  | 
  | 	/**
  | 	 * Default constructor.
  | 	 */
  | 	public CopyOfProcessMDB() {
  | 		// TODO Auto-generated constructor stub
  | 	}
  | 
  | 	/**
  | 	 * @see MessageListener#onMessage(Message)
  | 	 */
  | 	public void onMessage(Message message) {
  | 
  | 		JbpmConfiguration jbpmConfig = JbpmConfiguration.getInstance();
  | 		JbpmContext jbpmContext = jbpmConfig.createJbpmContext();
  | 
  | 		try {
  | 
  | 			TextMessage txt = (TextMessage) message;
  | 			ProcessInstance processInstance = jbpmContext
  | 					.newProcessInstanceForUpdate("TestProcess");
  | 			
  | 			processInstance.signal();
  | 			jbpmContext.save(processInstance);
  | 
  | 		} catch (final Exception exc) {
  | 			try {
  | 				exc.printStackTrace();
  | 
  | 				// jbpmContext.setRollbackOnly(); old stuff when using bean managed
  | 
  | 			} catch (final Exception e) {
  | 
  | 			}
  | 		} finally {
  | 			// jbpmContext.close();  same on bean managed
  | 
  | 		}
  | 
  | 	}
  | 
  | }
  | 

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

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



More information about the jboss-user mailing list