r7100 - dumbhippo/trunk/server/src/com/dumbhippo/server/impl
- From: commits mugshot org
- To: online-desktop-list gnome org
- Subject: r7100 - dumbhippo/trunk/server/src/com/dumbhippo/server/impl
- Date: Wed, 19 Dec 2007 14:10:54 -0600 (CST)
Author: otaylor
Date: 2007-12-19 14:10:54 -0600 (Wed, 19 Dec 2007)
New Revision: 7100
Modified:
dumbhippo/trunk/server/src/com/dumbhippo/server/impl/LastFmUpdaterBean.java
dumbhippo/trunk/server/src/com/dumbhippo/server/impl/MusicSystemBean.java
Log:
Fix missing DMSession when adding tracks from last.fm or Rhapsody
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/impl/LastFmUpdaterBean.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/impl/LastFmUpdaterBean.java 2007-12-19 20:08:23 UTC (rev 7099)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/impl/LastFmUpdaterBean.java 2007-12-19 20:10:54 UTC (rev 7100)
@@ -26,7 +26,9 @@
import com.dumbhippo.server.LastFmUpdater;
import com.dumbhippo.server.MusicSystem;
import com.dumbhippo.server.NotFoundException;
+import com.dumbhippo.server.dm.DataService;
import com.dumbhippo.server.util.EJBUtil;
+import com.dumbhippo.server.views.SystemViewpoint;
import com.dumbhippo.services.LastFmTrack;
import com.dumbhippo.services.LastFmWebServices;
import com.dumbhippo.services.TransientServiceException;
@@ -142,6 +144,12 @@
TxUtils.runInTransactionOnCommit(new TxRunnable() {
public void run() throws RetryException {
+ /* Using SystemViewpoint here is a little dubious, but there is no actual access
+ * control involved and it saves us having to do deal with the fact that we are
+ * adding tracks for multiple users if multiple users have the same last.fm
+ * username in their account.
+ */
+ DataService.getModel().initializeReadWriteSession(SystemViewpoint.getInstance());
addNewTracks(username, tracks, previousHash);
}
});
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/impl/MusicSystemBean.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/impl/MusicSystemBean.java 2007-12-19 20:08:23 UTC (rev 7099)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/impl/MusicSystemBean.java 2007-12-19 20:10:54 UTC (rev 7100)
@@ -40,6 +40,7 @@
import org.slf4j.Logger;
import com.dumbhippo.GlobalSetup;
+import com.dumbhippo.Site;
import com.dumbhippo.ThreadUtils;
import com.dumbhippo.TypeUtils;
import com.dumbhippo.identity20.Guid;
@@ -1281,6 +1282,7 @@
TxUtils.runInTransactionOnCommit(new TxRunnable() {
public void run() throws RetryException {
User attached = em.find(User.class, userId);
+ DataService.getModel().initializeReadWriteSession(new UserViewpoint(attached, Site.NONE));
addTrackHistory(attached, getTrack(properties), new Date(virtualPlayTime), false);
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]