View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007952 | MMW v4 | Framework: Scripts/Extensions | public | 2011-06-14 22:32 | 2011-11-12 00:18 |
Reporter | zvezdan | Assigned To | |||
Priority | none | Severity | minor | Reproducibility | always |
Status | feedback | Resolution | reopened | ||
Product Version | 4.0 | ||||
Fixed in Version | 4.0 | ||||
Summary | 0007952: AV error with QuerySongs and SDBPlaylist.AddTrack [MM4] | ||||
Description | I am getting the Access Violation error: "Starting a transaction while some query is open" on the line with SDBPlaylist.AddTrack. The same code works fine in MM3. I have another query with QuerySongs in my script, but it seems that this error occurs with any query. I am using now a solution with SDBPlaylist.AddTracks instead, but it is just a workaround. | ||||
Additional Information | Option Explicit Sub OnStartup() Dim oMenuItem Set oMenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0) oMenuItem.Caption = "Test SDBPlaylist.AddTrack" oMenuItem.UseScript = Script.ScriptPath oMenuItem.OnClickFunc = "Test" End Sub Sub Test(oItem) Dim oPlaylist Dim oSongIter Set oPlaylist = GetPlaylist("TestAddTrack") If oPlaylist Is Nothing Then Set oPlaylist = SDB.PlaylistByTitle("").CreateChildPlaylist("TestAddTrack") End If oPlaylist.Clear Set oSongIter = SDB.Database.QuerySongs("ID IN (SELECT ID FROM Songs LIMIT 100)") Do While Not oSongIter.EOF oPlaylist.AddTrack oSongIter.Item oSongIter.Next Loop End Sub Function GetPlaylist(sPlayListName) Dim oCurPlaylist Dim oSubPlaylists Dim j Set oCurPlaylist = SDB.PlaylistByTitle("") Set oSubPlaylists = oCurPlaylist.ChildPlaylists If oSubPlaylists.Count Then j = 0 Do While j < oSubPlaylists.Count If oSubPlaylists.Item(j).Title = sPlayListName Then Set oCurPlaylist = oSubPlaylists.Item(j) Exit Do ElseIf j = oSubPlaylists.Count - 1 Then Set oCurPlaylist = Nothing Exit Do End If j = j + 1 Loop Else Set oCurPlaylist = Nothing End if Set GetPlaylist = oCurPlaylist End Function | ||||
Tags | No tags attached. | ||||
Fixed in build | 1392 | ||||
|
Fixed in build 1391. - The regression was caused by a performance improvement. It will no longer cause an error message, however for performance reasons I'd suggest to avoid DB updates while a query is opened. I.e. a preferred solution would be to get a list of tracks to a memory structure and only then perform required actions. Not a big deal for few tracks, but can make a difference for thousands of tracks. |
|
I am still getting the mentioned AV error, but not always and I cannot reproduce it. However, I am now getting the another AV error "Thread creation error: Not enough storage is available to process this command." more often. I think it happens only if I have selected node with the playlist which is updating with AddTrack. By the way, I understand the performance problem and as I said I already have modified script using SongList object and AddTracks method instead. However, maybe there exist scripts with similar code from other users that are not upgraded anymore and because of them you should keep compatibility. |
|
Fixed in build 1392. - Thanks, there was yet one more different issue. |
|
Well, I got the same AV error "Starting a transaction..." with 1392, but only after approx. 30 attempts. So, maybe it could stay as resolved. |
|
Zvezdan, this shouldn't ever occur, in case you can reproduce while capturing a debug log, please e-mail it to me (with a rough indication of a line number where the problem occured). Thanks. |
|
If you have not received Zvezdan Mail I uploaded it to FTP for your revision. |