PDA

View Full Version : MsSQL Driver Issues ??



phvwijk
15-May-2017, 07:22 PM
Hi,

Used the "SQL Connect/Repair Wizard" to update the int files from a database on the server. The int file have many updates and changed. One off course the index settings. Server, Client only, Server only. That setting is not available in the dbBldr. Any specific reason why not.

After the update of the int files I do expect it to reflected in the cch files. But the timestamps remained the same and the content stayed the same. I do expect it to be changing. Or at least to be created again. This because the timestamp will be different between the cch file and corresponding int file.
So removed all the cch files and opened some files in the dbExplorer. But no cch is create. Should that no happening. Can recall I was using tag all bad entries in the dbBldr and all the cch files were created if they were not there. But could be wrong.

If I open the database from within the application, the cch files do get created. What is the difference. Is daw opening the files differently. Are the tools not respecting the "global" mssqldrv.ini file in the bin folder?


Peter

Stephen W. Meeley
16-May-2017, 09:38 AM
Peter,

When using the development tools we do not update the .cch files (I'm not sure if this is new to 19.0). The reasoning behind that change is that during development it's not really necessary to have updated .cch files and having them constantly updated was actually confusing to some developers. When the application is run the set of cchs files will be updated appropriately (if they are defined as being used).

phvwijk
16-May-2017, 01:14 PM
Stephen,

Nor a 100% sure, but pretty sure older version of dataflex did create the cch file. Looking at an old directory of 2011 I see all the cch files for each int file. It are close to 900 files because it is an connection to a database which is not mine. And there is no way I did open all the files in my code.

I do not see the point of not having them updated. When I test/run my program, something we most likely do, I am anyway creating or updating the cch files. The default in the int files is creating the cch files so to me the tools can create the cch files too. So I have to switch it off in the MSSQLDRV configuration file, which I doubt someone will do. But maybe I am wrong in that

Peter

Stephen W. Meeley
16-May-2017, 02:01 PM
Peter,

I don't understand why you think you need to do anything. If you want .cch files to be used in your deployed application you keep the setting on in the mssqldrv.int file and leave it (just like always). The .cch files just won't be updated until the application is run instead of by the tools.

Chris Spencer
16-May-2017, 08:48 PM
Stephen

Not sure if i understood you.

you said



The .cch files just won't be updated until the application is run instead of by the tools.



In my experience if you supply a new app with changed file definitions the cch files need to be deleted prior to the app being run to recreate them else you get field out of range errors etc

Your statement seemed to imply that 19 'knows' there is a change and regenerates the cchs.

Did I misunderstand what you meant?

Stephen W. Meeley
17-May-2017, 05:59 AM
Chris,

The out-of-date cch files should be updated automatically (because it detects newer .int files) - you shouldn't have to delete the old versions first. The only exception would be for table changes made using backend tools where the .int file was not changed. In that case you need to delete the out of date cch file first.

Of course, since you are deploying an updated application (if you made structural changes to the database it's a pretty sure bet you are updating the application as well) you can always choose to delete the entire set of cch filess and run the app to recreate them all as part of your update process.

phvwijk
17-May-2017, 08:10 AM
Stephen,

I prefer the dataflex tool respect the setting in the mssqldrv setting file. That is what I expect it to be doing. I have been in trouble in the past where cch got out of sync.

Like I wrote before I was pretty sure the cch files were created and updated in the past by the tools. Could be I am wrong in that one, but it should be clearly documented. If it was changed in a revision I must have overlooked when read whats new.

Read the Topic "Structure Caching" in the help

Also Take look at the Refresh Table... In the Database menu.

The help states:

This option does not touch the tables or the .INT files. It rebuilds the .CCH, .FD and .DD files.


Just tested this and it did not update the CCH file


Peter

Martin Moleman
18-May-2017, 03:13 AM
The DataFlex 19.0 Studio does no longer use cache files. This means the Studio does no longer read or write CCH files.

The main reason is that in a development environment you really should not use cache files.

In development, structure changes are done very often and it chances are greater cache files get out of sync with the actual structure. This is especially the case if you make changes outside the DataFlex Studio, for example in SQL Management Studio. In that situation you should not use cache files, because changes to table structure changes are not seen and you can easily end up with out-of-sync CCH files.

Remember cache files are only used to increase table open speed. That is important in a deployed situation, where at program startup lots of tables can be opened.
But in a development environment it is really more important to have your table structures right.

Marco
18-May-2017, 04:45 AM
Hmmm, in a System with 800+ tables where opening each table (without cch) takes 1 to 2 seconds over VPN, that will be an issue...
Please let me know how to revert using cch for studio.
As studio opens the tables when hovering etc, i expect freezes that will make the studio unusable...

Peter van Mil
18-May-2017, 04:52 AM
Hi Martin,

Good to know that this is changed. In most cases it is an improvement.

@Dennis Is this something for the release notes?

Dennis Piccioni
24-May-2017, 10:56 PM
Hi Peter,

we are making sure it's in there and also in the Studio and CCH file docs.