Hi, I have the following problem: I have a MDB (EJB 3.0 on AS: 4.0.5.GA) that consumes messages from a queue. In the onMessage method I am calling the method of a Stateless Session Bean (injected with SEAM-mechanism).
public void onMessage( Message msg )
{
// extract userId and type from msg - both string variable
try{
this.requestManager.insert(userId, type) // stateless session bean injected with seam
catch ( JMSException e ){
e.printStackTrace();
}
}
public void insertPemRequest( String userId, String type )
{
Person person = new Person( userId, type );
try
{
this.entityManager.persist( examRequest );
this.entityManager.flush();
// create business process in jbpm
}
catch ( ConstraintViolationException exp ){
// do nothing, i.e do not kick off new business process
}
catch ( EntityExistsException entityEx ) {
// do nothing, i.e do not kick off new business process
}
}
@Entity
@Table( uniqueConstraints= {@UniqueConstraint(columnNames={"userId", "type"}) } )
public class Person {
// ---- getter/setter for id, name, type
}
What type of Exceptions should an MDB throw?
The quick answer is none.