Page 3 of 5

Re: Problems with an application using ADO

PostPosted: Mon Jun 10, 2013 10:41 pm
by James Bott
Lucas,

It was not in previous build, so it is related with MsgBar or changes in TControl/TWindow as a result of a post from Antonio´s at Harbour Developers list.


Do you have, or can you make, a small example program that shows the problem so Antonio can find a solution?

Regards,
James

Re: Problems with an application using ADO

PostPosted: Tue Jun 11, 2013 12:02 am
by Antonio Linares
Yes. please. we need an example. thanks

Re: Problems with an application using ADO

PostPosted: Tue Jun 11, 2013 7:52 am
by lucasdebeltran
Antonio,

samples\ribbon.prg

Open and wait 15 minutes. Next, click on Cut/copy.

Re: Problems with an application using ADO

PostPosted: Tue Jun 11, 2013 9:31 am
by nageswaragunupudi
lucasdebeltran wrote:Antonio,

samples\ribbon.prg

Open and wait 15 minutes. Next, click on Cut/copy.


I confirm the problem that the application freezes if the prg is built with Harbour. We need to kill the task from Task Manager.

There is no problem if built with xHarbour.

Re: Problems with an application using ADO

PostPosted: Tue Jun 11, 2013 9:45 am
by nageswaragunupudi
Enrico Maria Giordano wrote:Dear friends, have you ever had problem with ADO? My customer says that the application freezes at random point and loose the buttonbar icons. Other applications using DBFs works fine. It says that the problem started a couple of days ago. I can't reproduce it in my XP (he's using W7).

Any ideas?

EMG

Obviously the program was not built with FWH 13.05.
May we know if the app was built with xHarbour or Harbour?

In my experience over years, ADO application could freeze if the connection to the Server is lost due to network failure while a connection is open. Except that I never found any other difference between dbf based and ado based application.

Other issues that were discussed relate to resource leaks and freezing of app built with FWH13.05 and Harbour in the case Mr Lucas pointed out.

Losing of bitmaps can happen when there are resource leaks in any application ( fwh or not ) that were run or running currently on the PC. We have means to check resource leaks in an FW app before release.

The issue relating to Harbour appln built with FWH13.05 exists and we need to find solution. The fact that app built with xHarbour does not freeze should give some clue. But I dont think this has any relation to the problem reported by Mr EMG in his first post.

Re: Problems with an application using ADO

PostPosted: Tue Jun 11, 2013 10:12 am
by Enrico Maria Giordano
Nageswararao,

nageswaragunupudi wrote:Obviously the program was not built with FWH 13.05.


The problem is with FWH 13.05.

nageswaragunupudi wrote:May we know if the app was built with xHarbour or Harbour?


xHarbour.

nageswaragunupudi wrote:In my experience over years, ADO application could freeze if the connection to the Server is lost due to network failure while a connection is open. Except that I never found any other difference between dbf based and ado based application.


The problem is not tied to ADO, as I already pointed out.

nageswaragunupudi wrote:The fact that app built with xHarbour does not freeze should give some clue.


As I already said, I'm using xHarbour and the app does freeze.

EMG

Re: Problems with an application using ADO

PostPosted: Tue Jun 11, 2013 10:15 am
by nageswaragunupudi
lucasdebeltran wrote:Antonio,

samples\ribbon.prg

Open and wait 15 minutes. Next, click on Cut/copy.


While we shall be working on this, can you please indicate if you experienced such a freeze in apps without using ribbonbar?

Re: Problems with an application using ADO

PostPosted: Tue Jun 11, 2013 10:18 am
by nageswaragunupudi
Mr EMG
As I already said, I'm using xHarbour and the app does freeze.

The app indicated by Lucas is not freezing when I built with xHarbour.
While I keep trying again, can you suggest any other such program?

Re: Problems with an application using ADO

PostPosted: Tue Jun 11, 2013 10:31 am
by Enrico Maria Giordano
I think that the problem might be the following line in tmsgitem.prg:

Code: Select all  Expand view
METHOD Refresh() INLINE ::hBack := nil, ::oMsgBar:Refresh()


EMG

Re: Problems with an application using ADO

PostPosted: Tue Jun 11, 2013 10:34 am
by Daniel Garcia-Gil
Enrico

yes is there, to solve

Code: Select all  Expand view
METHOD Refresh() INLINE DeleteObject( ::hBack), ::hBack := nil, ::oMsgBar:Refresh()

Re: Problems with an application using ADO

PostPosted: Tue Jun 11, 2013 10:40 am
by Enrico Maria Giordano
Daniel,

Daniel Garcia-Gil wrote:Enrico

yes is there, to solve

Code: Select all  Expand view
METHOD Refresh() INLINE DeleteObject( ::hBack), ::hBack := nil, ::oMsgBar:Refresh()


Ok, but the other problem is that there is already a Refresh method defined in that class.

EMG

Re: Problems with an application using ADO

PostPosted: Tue Jun 11, 2013 10:55 am
by Daniel Garcia-Gil
no problem

set all together

Code: Select all  Expand view

METHOD Refresh() CLASS TMsgItem

   local cMsg

   if ::bMsg != nil
      cMsg = cValToChar( Eval( ::bMsg ) )
      if cMsg != ::cMsg .or. ::lActive != ::lWasActive
         ::cMsg = cMsg
         if IsWindowVisible( ::oMsgBar:hWnd )
            ::Paint()
         endif  
         ::lWasActive = ::lActive
      endif
   endif

   DeleteObject( ::hBack)
   ::hBack := nil
   ::oMsgBar:Refresh()

return nil
 


and delete

Code: Select all  Expand view
METHOD Refresh() INLINE DeleteObject( ::hBack), ::hBack := nil, ::oMsgBar:Refresh()

Re: Problems with an application using ADO

PostPosted: Tue Jun 11, 2013 12:30 pm
by nageswaragunupudi
This fixes the msgbar problem, including a resource leak.

Re: Problems with an application using ADO

PostPosted: Tue Jun 11, 2013 3:21 pm
by Enrico Maria Giordano
Strangely enough, my answer is vanished. Anyone of the admins have deleted it for any reasons? Anyway, here it is again:

Daniel,

Daniel Garcia-Gil wrote:no problem

set all together

Code: Select all  Expand view

METHOD Refresh() CLASS TMsgItem

   local cMsg

   if ::bMsg != nil
      cMsg = cValToChar( Eval( ::bMsg ) )
      if cMsg != ::cMsg .or. ::lActive != ::lWasActive
         ::cMsg = cMsg
         if IsWindowVisible( ::oMsgBar:hWnd )
            ::Paint()
         endif  
         ::lWasActive = ::lActive
      endif
   endif

   DeleteObject( ::hBack)
   ::hBack := nil
   ::oMsgBar:Refresh()

return nil
 


and delete

Code: Select all  Expand view
METHOD Refresh() INLINE DeleteObject( ::hBack), ::hBack := nil, ::oMsgBar:Refresh()


Are you absolutely sure this is the correct fix for the freezing problem? My client is angry... :-(

EMG

Re: Problems with an application using ADO

PostPosted: Tue Jun 11, 2013 3:21 pm
by Enrico Maria Giordano
NageswaraRao,

nageswaragunupudi wrote:This fixes the msgbar problem, including a resource leak.


Thank you.

EMG