ADO RDD xHarbour

Re: ADO RDD xHarbour

Postby AHF » Tue May 26, 2015 8:31 am

Lucas,

ConnectionTimeout does not function the way we needed this only avoids the timeout default of 15s of ado.
If you set it to 0 ado will try forever otherwise throws error.
I think we should set it to 60 seconds then ask the user if he likes to continue trying.

The DBA from our client advise us to do the following:

Place a timer pinging to the server
When it fails close the connection and open a new one.
The recordsets should remain ok
I just don't know if then we would need a :filter to have all pending records updates and to skip through all of them issuing the updates failed during the time of the lost connection.

Or

Configure the OleDb or ODBC to avoid that enabling automatic reconnect.

How can we catch the connection lost error?

Do you or anyone have any experience with this. Mr Rao? Enrico? Rick?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Tue May 26, 2015 3:22 pm

Antonio,

Filters seem to be working ok.

I have to do more tests.

Congrats !!.

Also, I have to say that your ADORDD is much faster than SQLRDD from xHarbour.com and Patrick Mast.

Thank you.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: ADO RDD xHarbour

Postby AHF » Tue May 26, 2015 3:35 pm

Lucas,

I just emailed you a new version with:

Filters with updates and addnew and indexes completed.
Index on now adds the index to the opened indexes list. You can use after just ordsetfocus().

Please check it and let me know your findings.

Also, I have to say that your ADORDD is much faster than SQLRDD from xHarbour.com and Patrick Mast.


Great to know.

Just got from the trials in our client that the speed might be much improved in relations were we are querying with select the table and now we are trying using a clone set with :filter finding the recno in the main set.

Also there is a problem in the connection property "Maximum Open Rows" that we cannot set because iits always read only.
This prop together with CacheSize has a huge impact on select * in big tables.
We are trying to find how to do it.
Do you have any knowledge about this? Maybe Mr Rao.

Concerning lost connections see my email.

Thanks.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Tue May 26, 2015 5:09 pm

Antonio,

With the version you send me a coupple of hours ago, filters are failing again.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: ADO RDD xHarbour

Postby AHF » Tue May 26, 2015 5:14 pm

Lucas,

Sorry it was my mistake.

Please see my email.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Tue May 26, 2015 5:29 pm

Lucas,

Concerning connection lost control I just receive a information from our client to try this way:

Timer issuing a dummy query to the server or checking state of the connection.
If it fails "locks" immediately all updates to the recordset and only "unlocks" updates when the connection come back again.
I hope this is possible.

It seems that since the actual connection is lost any pending transactions will be rolled back. (this is with their server) I dont know if it is like this elsewhere.

Thus we are going this way. Does anynone has any other better alternative?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Tue May 26, 2015 5:32 pm

Lucas,

Concerning eval error this only happens when you dont have a active filter Right?
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Tue May 26, 2015 5:44 pm

Yes.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: ADO RDD xHarbour

Postby Enrico Maria Giordano » Wed May 27, 2015 2:43 pm

Antonio,

AHF wrote:How can we catch the connection lost error?

Do you or anyone have any experience with this. Mr Rao? Enrico? Rick?


What about TRY/CATCH/END?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8356
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: ADO RDD xHarbour

Postby AHF » Wed May 27, 2015 3:29 pm

Enrico,

Thanks but we choose other way.

adordd will use a timer to keep connection live.
And a test in certain routines to see if it is connected otherwise it let you do anything but:

Updates, New records, changing index orders

You will continue to work disconnected and as soon as you get connected again everything comes back to normal operation.

With this we hope to avoid lost connection for the lack of activity
Nevertheless if you loose con you continue to work but with some limitations

I didnt try it yet.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby lucasdebeltran » Fri May 29, 2015 10:05 am

Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: ADO RDD xHarbour

Postby lucasdebeltran » Tue Jun 02, 2015 7:14 am

Antonio,

xBrowse feature wildseek is not working.

When you type values, it filters, but when you start deleting such value filtered records are still on xbrowse.

Please test this code with DBFCDX and ADORDD:

At. :cFilterFld := "FIRST" you have to indicate the field you want to filter for.


Code: Select all  Expand view


//-----------------------------------------------------------------------------
function testWildSeek( cAlias )
//-----------------------------------------------------------------------------

   local oDlg, oBrw, oCbx, oFont, nWild := 2
   local nOpt        := 1




   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14

   DEFINE DIALOG oDlg SIZE 900,400 PIXEL ;
      TITLE "Test WildSeek v. 3 "+FWVERSION ;
      FONT oFont

   @ 30,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
      DATASOURCE cAlias AUTOCOLS AUTOSORT ;
      CELL LINES NOBORDER



   WITH OBJECT oBrw

      :nMarqueeStyle := 4
      :lIncrFilter   := .t.
      :lSeekWild     := .t.
      :cFilterFld    := "FIRST"
      :nStretchCol   := STRETCHCOL_WIDEST

      :CreateFromCode()
   END


/*
   @ 10,10 COMBOBOX nOpt PROMPTS { "Starting With", "Containing" } ;
      SIZE 60,44 PIXEL OF oDlg  ;
      ON CHANGE ( oBrw:lSeekWild := ( nOpt == 2 ), ;
                  oBrw:Seek( If( oBrw:lSeekWild, oBrw:cSeek, "" ) ),;
                  oBrw:Refresh(), oBrw:SetFocus() )
*/



   @ 10, 80 SAY oBrw:oSeek PROMPT oBrw:cSeek SIZE 120,10 PIXEL OF oDlg ;
      COLOR CLR_RED,CLR_YELLOW

   @ 10, 210 BUTTON  "Clean xBrowse WildSeek" ACTION ( oBrw:Seek( "" ), oBrw:Setfocus() )    PIXEL

   @ 10, 350 BUTTON  "DbClearFilter()" ACTION ( msgalert( dbfilter(), "ACTIVE FILTER" ), dbclearfilter(), oBrw:Setfocus() )    PIXEL


   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oBrw:SetFocus(), .f. )

   RELEASE FONT oFont


Return nil

//----------------------------------------------------------------------------//


 



Thank you.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: ADO RDD xHarbour

Postby AHF » Fri Jun 12, 2015 9:02 am

Stay tuned adordd its ready and Ill post new version later today.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby AHF » Fri Jun 12, 2015 7:42 pm

Adordd its ready to work at https://github.com/AHFERREIRA/adordd.git

It has been in development since Feb 2015 and being tested on real application working in parallel with the actual application with ADS and passed all trials.
This app with adordd its now being tested intensive on concurrent access to check locking scheme and exclusive use.
Will report results end next week.

With adordd you can migrate immediately to any SQL server although all the trials have been made only with ADS, MySql and MS Access.

No change code required. Except:

1) As with ADS in index expressions you have to evaluate vars before send it to adordd.

2) Delete records are immediately removed from table and cant be recovered again. So code like:
Code: Select all  Expand view

Delete record recno
BlankRec()  //this will not work either comment it or place it before delete.

delete all  //this will not work take it from here
while....
 if lcondition  //change condition to not
   recall record  //delete each record here
 endif
end
 


Thats it!

But you can do much more:
Code: Select all  Expand view

hb_GetAdoConnection():Execute("CREATE VIEW cView ....")

sele 0
use cView

Browse()
 


True locks as any other rdd.
Upload tables to any Sql server just like:

Code: Select all  Expand view

use table VIA "DBFCDX"
copy to sqltable via "ADORDD"

 


Performance its quite good.
No Sql knowledge needed unless you want to use and run sql statements directly from ado functions.
You write code exactly the same as any other rdd.

With adordd we are free from all kind of limitations with tables and index management already in actual and future operating systems and will extend the life of our applications further.

Although ADO it already today an "old" framework I think it will stay around for the next coming years (I hope so)

Ill give support to it as long as you can supply precise ideas and sample code where something has not been foreseen in adordd scope of action.

I hope that it will do the job for you all as it does for me.
Regards
Antonio H Ferreira
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: ADO RDD xHarbour

Postby byte-one » Mon Jun 15, 2015 11:58 am

Antonio, at this place on line 5348 the rdd should not be hardcoded!

Code: Select all  Expand view
IF !FILE(cTable)
     DBCREATE(cTable,;
     { {"CODLOCK","C",50,0 }},;
     "DBFCDX",.T.,"TLOCKS")
     INDEX ON CODLOCK TO (cIndex)
  ENDIF

should be
Code: Select all  Expand view
IF !FILE(cTable)
     DBCREATE(cTable,;
     { {"CODLOCK","C",50,0 }},;
     rRdd,.T.,"TLOCKS")
     INDEX ON CODLOCK TO (cIndex)
  ENDIF
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 47 guests