Page 1 of 1

Conversion of CachedLobs to LobCacheMode

Posted: 07.04.2021, 21:48
by MJFShark
I've put in the pull request. A few notes:

I removed the code related to CachedLobs in procedure TZCachedResultSet.ResetCursor as I thought it might cause an issue for drivers that hard code the value.

I put the enumeration and some helper code in ZDbcIntfs. There may be a better place for it.

The LobCacheMode is now only set via properties, at the connection or dataset. E.g.:
ZConn.Properties.AddPair('LobCacheMode', 'OnAccess');
or
ZQuery.Properties.AddPair('LobCacheMode', 'OnLoad');

If TryKeepDataOnDisconnect is true the LobCacheMode will switch to "OnLoad" if it is currently "None". I use "OnAccess" with TryKeepData and it works very well.

I haven't tested:
The connection property editor
The ASA protocol
The SQLLite protocol
The ADO protocol

I don't think they'll be adversely affected, but just wanted to mention it.

-Mark

Re: Conversion of CachedLobs to LobCacheMode

Posted: 08.04.2021, 06:54
by marsupilami
Hello Mark,

thank you for the work. I applied your patch to my local copy but unfortunately the test suite has some thests that rely on doCachedLobs and will not compile anymore. I shelved (SVN speak for put them in a local branch) your patch, so I can apply it later on.
Could you please have a look at the test suite? Just open ZTestAll.dpr for your Delphi version and try to compile it. ZTestAll usually will use your installed packages. If you don't recompile the packages every time, you might want to add ..\..\src\core etc to your unit search path.

Thank you and best regards,

Jan

Re: Conversion of CachedLobs to LobCacheMode

Posted: 08.04.2021, 12:02
by MJFShark
Thanks! I've issued a new pull request with the test suite changes. I changed the test name to be more accurate, I assume they're read using rtti? I couldn't find a reference to the test name anywhere else in the code and the test compiled ok, but I need to look into how to setup the config file for my environment to actually run it.

-Mark

Re: Conversion of CachedLobs to LobCacheMode

Posted: 08.04.2021, 15:11
by marsupilami
I applied the patches to trunk / master and they seem to not raise any issues. Thank you :)

As for running the test suites: There is a wiki page - maybe it can help you: Running the Test Suites