Problem with synchronize [message #456710] |
Wed, 19 May 2010 05:39 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
ator
Messages: 43 Registered: March 2009
|
Member |
|
|
Hi,
In our applicatione we made a custom progressbar where we set di % and the use the synchronize to refresh it.
The bar works properly except that randomly the form stop to refresh (probably the synchronize stop working :s)
The code looks like
Loop
Set_progress_bar(%);
Synchronize;
End loop;
I already look around the forum and the web but i couldn't found a explanation for this.
I hope someone can help me and i apologize for my english
thanks,
Ator
|
|
|
Re: Problem with synchronize [message #456713 is a reply to message #456710] |
Wed, 19 May 2010 05:41 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
What does this mean exactly:
Quote:
The bar works properly except that randomly the form stop to refresh (probably the synchronize stop working :s)
Personally I wouldn't use a progress bar at all in forms. They just make slow processes slower.
|
|
|
|
|
Re: Problem with synchronize [message #456729 is a reply to message #456727] |
Wed, 19 May 2010 06:26 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
ator
Messages: 43 Registered: March 2009
|
Member |
|
|
Ah sorry your are right.
It means that at the beginning the progressbar is refreshing properly but after a while the form stop to refresh the bar.
For expamples the procedure start and the progressbar reach 16% and then is not refresh properly 'til the procedure end. The % change everytime (for this reason i said randomly) although the procedure and the data are the same.
I hope i explained the problem clearly enough :s
|
|
|
|
Re: Problem with synchronize [message #456752 is a reply to message #456732] |
Wed, 19 May 2010 07:34 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
ator
Messages: 43 Registered: March 2009
|
Member |
|
|
This is the code and after each call there is a synchronize but, as i said before, after few seconds the scrollbar is no longer refreshed. :S
PROCEDURE Set_Progress_bar (Elaborati Number ,
Da_elaborare Number ,
Messaggio VarChar2 ) IS
Next_Width Number(4);
Previous_Width Number(4);
BEGIN
:PROGRESS_BAR.Messaggio := Messaggio;
Next_Width := Floor(Elaborati/Da_Elaborare*400);
Previous_Width := Floor(Get_Item_Property('PROGRESS_BAR.Progress_Bar',Width));
If Previous_Width < 400 And Next_Width <> Previous_Width Then
Set_Item_Property('PROGRESS_BAR.Progress_Bar',Width, Next_Width);
:PROGRESS_BAR.Position := To_Char(Round(Next_Width/4,2),'990.00') || '%';
Synchronize;
End If;
If Elaborati >= Da_Elaborare Then
Set_Item_Property('PROGRESS_BAR.Progress_Bar',Width,400);
:PROGRESS_BAR.Position := '100.00%';
End If;
END;
I hope this can help.
Thanks,
Ator
|
|
|
Re: Problem with synchronize [message #456753 is a reply to message #456752] |
Wed, 19 May 2010 07:40 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
So far so simple. Though I have to ask - there's a syncronize in the procedure, so why do you need one after you call it?
Most likely problem is the procedure is simply not called between the point it stops and the end.
So you need to give a lot more details about how it is called - what is the process you are trying to track the progress of?
|
|
|
|
Re: Problem with synchronize [message #456778 is a reply to message #456774] |
Wed, 19 May 2010 08:42 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
I would suggest a debugging procedure at this point.
Create a table that will store the values you pass to set_progress_bar.
Create a procedure in the db that will insert the values into the table. Make it an autonomous_transaction.
Call the procedure from set_progress_bar.
Run the form.
Query the table to see exactly how often set_progress_bar got called and what values were used.
However I would stress again that this is a really bad idea.
If you are looping over thousands of records then the additional overhead of the progress bar is going to be immense.
What sort of processes are you doing here - updates, inserts?
If either of those I'd look to rewrite it as a single SQL statement. With a bit of luck it'll be fast enough to make a progress bar irrelevant.
|
|
|
|
|
Re: Problem with synchronize [message #457184 is a reply to message #457099] |
Fri, 21 May 2010 10:40 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
ator
Messages: 43 Registered: March 2009
|
Member |
|
|
Hi,
Unfortunatly i can't post the original code because sa i said we use the progress bar in many different form but the structure is always the one i post earlier.
But anyway i guess is a windows/6i issue because rarely if i don't do anything the progress bar reach 100% and also because we use the same code in 10g and we have no problem.
Probably it just lost focus and it freezs.
Thanks for your help,
Ator
|
|
|
|
|
Re: Problem with synchronize [message #457494 is a reply to message #456710] |
Mon, 24 May 2010 17:16 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
gregor
Messages: 86 Registered: March 2010 Location: Germany
|
Member |
|
|
Hi ator,
by the way .
Every Query/Procedure ( "you sayed_:.... varouse procedute for maniplating data"
) prevends Forms, until the job is finished, to send a signal to your progressbar.
have you checked the time, consuming by this steps?
Gregor
|
|
|