re>

 public run() {
   // Begin of task
   InitialContext ctx = new InitialContext();
   UserTransaction ut = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
   ut.begin();

   // Perform transactional business logic

   ut.commit();
 }
 </pre>
 Tasks can optionally provide an <a href="ManagedTaskListener.html" title="interface in jakarta.enterprise.concurrent"><code>ManagedTaskListener</code></a> to receive
 notifications of lifecycle events, through the use of <a href="ManagedTask.html" title=