Home » Developer & Programmer » Forms » Problem with synchronize (Oracle forms 6i)
Problem with synchronize [message #456710] Wed, 19 May 2010 05:39 Go to next message
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 messageGo to next message
cookiemonster
Messages: 13938
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 #456723 is a reply to message #456713] Wed, 19 May 2010 06:05 Go to previous messageGo to next message
ator
Messages: 43
Registered: March 2009
Member
Yes me too but unfortunatly we must show to the user at which point the elaboration of the data is :s
Re: Problem with synchronize [message #456727 is a reply to message #456723] Wed, 19 May 2010 06:11 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Up to you.
You didn't answer my question.
Re: Problem with synchronize [message #456729 is a reply to message #456727] Wed, 19 May 2010 06:26 Go to previous messageGo to next message
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 #456732 is a reply to message #456729] Wed, 19 May 2010 06:45 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Post the code of Set_progress_bar
Re: Problem with synchronize [message #456752 is a reply to message #456732] Wed, 19 May 2010 07:34 Go to previous messageGo to next message
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 messageGo to next message
cookiemonster
Messages: 13938
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 #456774 is a reply to message #456753] Wed, 19 May 2010 08:30 Go to previous messageGo to next message
ator
Messages: 43
Registered: March 2009
Member
every procedure where we use the progress bar are made in the follow away.
procedure XYZ (parameter) Is
 cursor data is
    select x from y;
 tot_row number;
  row number := 1;
begin
  select count(*)
  into tot_row
  from y;
 
  open data;
  loop
   fetch data into...
   exit when data%notfound;
   set_progress_bar(row,tot_row,message);
   synchronize;
   
   -- varouse procedute for maniplating data

  end loop;
  close data;
end;


The synchronized is called for eache row but after a while it stop refreshing all the form.

I hope that's enough anyway thanks for your time Smile

Ator
Re: Problem with synchronize [message #456778 is a reply to message #456774] Wed, 19 May 2010 08:42 Go to previous messageGo to next message
cookiemonster
Messages: 13938
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 #457099 is a reply to message #456778] Fri, 21 May 2010 01:18 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Me-thinks that 'row' or 'tot_row' is not being updated or set/reset.

Posting 'code' works best when you post the actual code and not some abbreviated version.

David
braindead david [message #457103 is a reply to message #456710] Fri, 21 May 2010 01:24 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
From Forms 10 help
SYNCHRONIZE only updates the screen display if both of the following conditions are true: Oracle Forms is at the item level in the forms hierarchy (i.e., SYSTEM.CURRENT_ITEM is not NULL). Note: Use SYNCRHONIZE with caution. Each call to SYNNCRHONIZE generates a network round-trip between the application server and the Forms Java client.

Perhaps the Application Server is sensing the massive network volume and is 'blocking' the replies. Then when the screen fields change it is actually sending the final screen.

You will have to put a 'sniffer' on the network to determine whether this is happening or not.

David
Re: Problem with synchronize [message #457184 is a reply to message #457099] Fri, 21 May 2010 10:40 Go to previous messageGo to next message
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 #457325 is a reply to message #457184] Sun, 23 May 2010 21:05 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Did removing the second 'synchronize;' make any difference?

David

PS Thanks LF and CM for noticing the incorrect placement of my 'quoting' reply.
Re: Problem with synchronize [message #457489 is a reply to message #456710] Mon, 24 May 2010 13:57 Go to previous messageGo to next message
ator
Messages: 43
Registered: March 2009
Member
Yes i did remove the second synchronize but the the problem still.

Anyway thanks to all for your time and help Smile

Ator
Re: Problem with synchronize [message #457494 is a reply to message #456710] Mon, 24 May 2010 17:16 Go to previous message
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
Previous Topic: Enter-Query mode - one item in a block is not getting cleared
Next Topic: How To Create Library Functions To Show Alert
Goto Forum:
  


Current Time: Thu Sep 19 19:47:34 CDT 2024