now using JPA annotations.
[utils] / mythtv / timer / src / main / java / org / wamblee / timer / TimerBean.java
index 45e6e220fa1c3b968d54f0d616e6fd1538937855..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;
@@ -36,6 +40,9 @@ import org.wamblee.io.DirectoryMonitor;
  * 
  */
 @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);