now using JPA annotations.
[utils] / mythtv / timer / src / main / java / org / wamblee / timer / TimerBean.java
index b7ee2bf3da0eb4818c0033a65630092b283deb46..ca9103017dc7dfa7a3c94ad63974123da2df3b02 100644 (file)
@@ -21,6 +21,10 @@ import javax.ejb.MessageDriven;
 import javax.ejb.Timeout;
 import javax.ejb.Timer;
 import javax.ejb.TimerService;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.ejb.TransactionManagement;
+import javax.ejb.TransactionManagementType;
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageListener;
@@ -35,7 +39,10 @@ import org.wamblee.io.DirectoryMonitor;
 /**
  * 
  */
-@MessageDriven(mappedName = "jms/MythtvTimer")
+@MessageDriven(name = "MythtvTimer")
+// Spring's JTA transaction manager does not work with container managed transactions
+// because it uses the UserTransaction object which glassfish forbids.
+@TransactionManagement(TransactionManagementType.BEAN)
 public class TimerBean implements MessageListener {
     
     private static final Log LOG = LogFactory.getLog(TimerBean.class);