Conversion of CachedLobs to LobCacheMode

Code patches written by our users to solve certain "problems" that were not solved, yet.

Moderators: gto, cipto_kh, EgonHugeist, mdaems

Post Reply
MJFShark
Expert Boarder
Expert Boarder
Posts: 218
Joined: 04.06.2020, 13:59

Conversion of CachedLobs to LobCacheMode

Post 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
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1962
Joined: 17.01.2011, 14:17

Re: Conversion of CachedLobs to LobCacheMode

Post 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
MJFShark
Expert Boarder
Expert Boarder
Posts: 218
Joined: 04.06.2020, 13:59

Re: Conversion of CachedLobs to LobCacheMode

Post 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
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1962
Joined: 17.01.2011, 14:17

Re: Conversion of CachedLobs to LobCacheMode

Post 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
Post Reply