mark_mueller
Occasional Observer

Please help me understand FS_RELEASE_TO in code

Jump to solution

Hi all,
im analyzing existing third party code in an custom executable which should automatically release dataset entries after a content transport including newly released items. As I understand the following code should find out which entries are changed but the result is often 0 although there are changed items

Select select = session.createSelect(content2.getEntityType().getName());
select.setConstraint(new LessThan("FS_RELEASE_TO", Long.MAX_VALUE));
EntityList changedEntities = session.executeQuery(select);
Logging.logInfo("changedEntities :" + changedEntities.size(), getClass());

I have not found helpful information about FS_RELEASE_TO. Does anyone of you understand what was the plan here and why it seems to fail sometimes?

Best regards,
Mark

0 Kudos
1 Solution

Accepted Solutions
hoebbel
Crownpeak employee

Dear Mark,

FS_RELEASE_TO indicates the time until which the corresponding version of the dataset was released. For currently released records the value is 9223372036854775807 (Long.MAX_VALUE), for changed datasets the value is 0.
Other values can be found only in historical versions of the dataset.
Example: If a dataset is modified and then released, the version of the dataset that was previously released (i.e. which had the value 9223372036854775807) gets the current date (in milliseconds since 1/1/1970 0am) (and the new version gets the value 9223372036854775807)
Other corresponding internal columns in the database are FS_VALID_FROM (since when is the dataset valid) and FS_VALID_TO (until when was the dataset valid). A dataset visible within the SiteArchitect/Content creator needs to have a FS_VALID_FROM value of a past date and a FS_VALID_TO value of a future date (normally 9223372036854775807).

It is somewhat more difficult to make a statement about why the query sometimes does not work. Based on the available information I can only guess, that it might be either because the query is executed with an outdated date or that a cache hits that does not yet contain the changes. Solution for the second case would be to reset the cache [<schema>.resetReadTimestamp() (https://docs.e-spirit.com/odfs/access/de/espirit/firstspirit/access/store/templatestore/Schema.html#...())].

Best regards
Holger

View solution in original post

1 Reply
hoebbel
Crownpeak employee

Dear Mark,

FS_RELEASE_TO indicates the time until which the corresponding version of the dataset was released. For currently released records the value is 9223372036854775807 (Long.MAX_VALUE), for changed datasets the value is 0.
Other values can be found only in historical versions of the dataset.
Example: If a dataset is modified and then released, the version of the dataset that was previously released (i.e. which had the value 9223372036854775807) gets the current date (in milliseconds since 1/1/1970 0am) (and the new version gets the value 9223372036854775807)
Other corresponding internal columns in the database are FS_VALID_FROM (since when is the dataset valid) and FS_VALID_TO (until when was the dataset valid). A dataset visible within the SiteArchitect/Content creator needs to have a FS_VALID_FROM value of a past date and a FS_VALID_TO value of a future date (normally 9223372036854775807).

It is somewhat more difficult to make a statement about why the query sometimes does not work. Based on the available information I can only guess, that it might be either because the query is executed with an outdated date or that a cache hits that does not yet contain the changes. Solution for the second case would be to reset the cache [<schema>.resetReadTimestamp() (https://docs.e-spirit.com/odfs/access/de/espirit/firstspirit/access/store/templatestore/Schema.html#...())].

Best regards
Holger