transaction not needed

This commit is contained in:
Athou
2013-04-16 10:53:56 +02:00
parent 852f834377
commit 11a9d68948

View File

@@ -4,7 +4,6 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.concurrent.Future; import java.util.concurrent.Future;
import javax.annotation.Resource;
import javax.ejb.AsyncResult; import javax.ejb.AsyncResult;
import javax.ejb.Asynchronous; import javax.ejb.Asynchronous;
import javax.ejb.Stateless; import javax.ejb.Stateless;
@@ -16,7 +15,6 @@ import javax.transaction.HeuristicRollbackException;
import javax.transaction.NotSupportedException; import javax.transaction.NotSupportedException;
import javax.transaction.RollbackException; import javax.transaction.RollbackException;
import javax.transaction.SystemException; import javax.transaction.SystemException;
import javax.transaction.UserTransaction;
import org.apache.commons.lang.mutable.MutableBoolean; import org.apache.commons.lang.mutable.MutableBoolean;
import org.apache.commons.lang.time.DateUtils; import org.apache.commons.lang.time.DateUtils;
@@ -46,9 +44,6 @@ public class FeedRefreshWorker {
@Inject @Inject
FeedRefreshTaskGiver taskGiver; FeedRefreshTaskGiver taskGiver;
@Resource
private UserTransaction transaction;
@Asynchronous @Asynchronous
public Future<Void> start(MutableBoolean running, String threadName) { public Future<Void> start(MutableBoolean running, String threadName) {
log.info("{} starting", threadName); log.info("{} starting", threadName);
@@ -102,8 +97,6 @@ public class FeedRefreshWorker {
feed.setErrorCount(errorCount); feed.setErrorCount(errorCount);
feed.setDisabledUntil(disabledUntil); feed.setDisabledUntil(disabledUntil);
transaction.begin();
if (fetchedFeed != null) { if (fetchedFeed != null) {
feedUpdateService.updateEntries(feed, fetchedFeed.getEntries()); feedUpdateService.updateEntries(feed, fetchedFeed.getEntries());
if (feed.getLink() == null) { if (feed.getLink() == null) {
@@ -112,8 +105,6 @@ public class FeedRefreshWorker {
} }
feedDAO.update(feed); feedDAO.update(feed);
transaction.commit();
} }
private Feed getNextFeed() { private Feed getNextFeed() {