Skip to Content
It is currently September 18th, 2019, 11:23 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Breather Failure
PostPosted: November 19th, 2008, 2:27 pm 
Offline
Experienced User
Experienced User

Joined: January 31st, 2004, 10:28 pm
Posts: 252
Location: Carrboro, North Carolina
From the PAL Quick Start Guide:

Code:
const Cat_From = 'MyCat1';
const Cat_To   = 'MyCat2';

var Q : TDataSet;
var T : Integer;

Q := CAT[Cat_From].SongList;

{Empty destination category}
CAT[Cat_To].Clear;

PAL.LockExecution;
Q.First;
while not Q.EOF do
begin
 CAT[Cat_To].AddFile(Q['filename'],ipBottom);
 Q.Next;
 
 {Take a breather}
 if (T mod 10) = 0 then PAL.UnlockExecution;
 if (T mod 10) = 0 then PAL.LockExecution;
 T := T + 1;
 {----------------}
end;
PAL.UnlockExecution;


However, it seems some "breathing" is going on if you're involved in a LARGE TDataSet. Is this because no breathing is really happening; perhaps because you can't Lock/Unlock in a if statement, just as you can't wait in an if statement?

Is there a way to pocess a large dataset and build in some waiting after say 200 items are processed?

_________________
-Keith (Lumper5) - Deeper Into Music
Celebrating more than 10 years streaming (as of Oct 2010)
Visit http://www.deeperintomusic.net | Facebook: Become a "fan" | Twitter: Follow the leader


Top
 Profile  
Reply with quote  
 Post subject: Re: Breather Failure
PostPosted: November 19th, 2008, 2:34 pm 
Offline
SVS Member
SVS Member

Joined: May 8th, 2004, 9:00 am
Posts: 10439
Location: Denver, CO
I'd suggest having a look at FesterHeads Album Conditioner PAL, it limits processing to 250 items at a time, so you might be able to grab some code from it.

_________________
- Rob Oyler, SVS
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Breather Failure
PostPosted: November 19th, 2008, 2:58 pm 
Offline
Alumni
Alumni

Joined: March 11th, 2003, 1:34 pm
Posts: 9959
Location: Maui, HI
Code:
if (T mod 10) = 0 then PAL.UnlockExecution;
if (T mod 10) = 0 then PAL.LockExecution;

The end result is the PAL is always in a locked state.

If the goal is to move songs from one category to another the following SQL portions may come in handy:
Code:
delete from categorylist where categoryid = <new_id>
update categorylist set categoryid = <new_id> where categoryid = <old_id>

For some reason this is making my skin itch; proceed with caution; highly suggest to test on a backup.

_________________
- Steve Kunitzer
- SVS (Spacial Volunteer Support) / Forum Administrator

Image
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Breather Failure
PostPosted: November 20th, 2008, 2:54 pm 
Offline
Experienced User
Experienced User

Joined: January 31st, 2004, 10:28 pm
Posts: 252
Location: Carrboro, North Carolina
Okay - full disclosure. I made a mistake. A variant of the code ref'ed above was embedded in another if then statement and that was causing the failure. Once I removed the if-then
{Take a breather}
if (T mod 10) = 0 then PAL.UnlockExecution;
if (T mod 10) = 0 then PAL.LockExecution;
T := T + 1;
worked perfectly, pausing for a seconding each iteration of 10. Sorry to post unnecesarrily.

_________________
-Keith (Lumper5) - Deeper Into Music
Celebrating more than 10 years streaming (as of Oct 2010)
Visit http://www.deeperintomusic.net | Facebook: Become a "fan" | Twitter: Follow the leader


Top
 Profile  
Reply with quote  
 Post subject: Re: Breather Failure
PostPosted: November 20th, 2008, 10:45 pm 
Offline
Alumni
Alumni

Joined: October 14th, 2006, 9:38 am
Posts: 5986
Location: Deep in the heart of the PRNJ
To paraphrase some guy named Edison:
"I didn't fail; I found lots of ways that didn't work." ;)

_________________
- Stan Olochwoszcz
A proud licensed SAM user since 2002

Raritan Bay Radio


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group