Assuming that you are using the connection factory from the ActiveMQ JCA RA and your session bean is running in a JTA context then the DB and JMS operation will be performed atomically (i.e. in the same transaction). However, the commit will not be 1-phase. It will be 2-phase since you'll be enlisting more than 1 resource into the transaction (i.e. the DB and the JMS broker).