The property "version" in File Resource changes for a file even when there is no change made to the file or its properties. So why does this happen? What could be the other conditions under which the version changes?
You really should read the documentation that you yourself linked before posting.
version long A monotonically increasing version number for the
file. This reflects every change made to the file on the server, even
those not visible to the requesting user.
Any time the file is changed the version number will be increased. Even if it is not changed by you but by someone or something else.
Related
I have a few objects that need to be Committed to GXServer but for some reason I am getting a failure. The message is something like:
'Commit failed: At least Environment 'Java Environment' was modified in GeneXus Server since your last update. Please Update Knowledge Base and retry.'
When I go to the Update Tab in GXS for this KB it is empty - I am in sync. It seems like I am stuck - the Commit side says Update but the Update side says I am in sync.
I have been able to Commit all of the objects except the one listed in this error. In my case, I am sure I have the latest version of the object, so I need to know how to force this object to GXS.
I wanted to share with the Community the answer I received from Support as it solved the problem. If you run into this and have questions you can ask Support and they can give you more official details. This is my take on the situation.
If you know the object in the error should be Committed, you can make a change to a file in your running GX version to 'force' the Commit. Here are the steps I followed:
You should be able to Commit all objects except the one in question. It is best IMO to commit all objects normally and only have the object in error listed.
Close GX
In Windows Explorer find the GeneXus installation folder (something like C:\Program Files (x86)\GeneXus\GeneXus16U5)
Open the file GeneXus.exe.config for editing ( you may need 'Run as Administrator')
Search for </appSettings>
Above this line, add a line with this information
<add key="ForceCommit" value="true"/>
Save your changes
Open KB and Commit the object in question
Once the object is committed, close GX and remove the line from the config file so you are not forcing future objects up.
This force process should NOT be used unless you are in this situation, and it should not be a normal occurrence.
Also, make sure you change the correct file. One time I edited a file with a similar name by mistake (even the contents looked similar), and it did not work.
The last time I performed this was in GX 16 U5. I do not know what the original issue was that caused the conflict, but this was the way I was given to force the Commit.
The AssemblyInfoPatcher build feature isn't working. Some files are patched and some are not.
Assembly file version was specified, but couldn't be patched in file D:\TeamCity\Agent\buildAgent\work\6afd998e316c631f\La\Di\Da\Properties\AssemblyInfo.cs. Is necessary attribute missing?
I thought it was because it was 1.0.* since one of the failed files had this format, and one of the successful ones had the default 1.0.0.0 format, so I changed the attribute to 1.0.0.0 across the entire solution and now none of them work.
I get either the error above or:
Assembly version attributes were not found in ...
The attribute is defined and at least two other people on the team have confirmed that they can also see it using their production eyes.
Happy to stump up the cash so I can smash my work keyboard.
Well, I managed to get it working but not.
I had a Configuration Parameter called AssemblyVersionStringWithCounter that I set from a PowerShell script. I was using this in the patcher feature.
I changed it to be composed of other parameters like
%MajorVersionNumber%.%MinorVersionNumber%.%BuildWeek%.%build.counter%
And now it mods the files but the params are not set, the version is incorrect. Seems the AssemblyInfoPatcher cannot use values set during the build steps.
Seems I've wasted about £800 of my client's money when I should have just PowerShelled it from the start. Code is King.
I am trying to change document content and save the changes into current version itself without increment the document version number using filenet java API.
Any one help me on this topic.
Changing content always leads to the creation of a new version. It is not possible to directly accomplish what you want.
If you need the version number intact, delete the current version and save the changes. Then create a new version.
As fnt said, the main goal of an ECM platform is to guarantee that a version content stays unchanged. The only thing doable, is to update as much times as you need the content of the checked out version (reservation). That can be useful for a Save (without CheckIn scenario). Don't know if that is useful to you. If not, you need to delete/re-create a new version to keep the same version number.
Delete, make changes to the document and recreate the same with updated content is the only solution.
Periodically I launch my app from Xcode to find Core Data errors due to an empty model file. The versioned model files are found in the main bundle but the model file still inits to nil. See my answer for partial workarounds but no solution to date.
I've verified that the files exist and are accessible using the access function. I've tried using initWithContentsOfURL and mergedModelFromBundles with the same result.
This happens randomly and I suspect something is changing the model file behind the scenes but I don't know what.
Restarting my computer seems to have solved the security related crash but this also necessitates removing the existing Core Data store file as it complains the existing one doesn't match the model file.
[UPDATE]
Restarting does not solve the problem. But reseting the current version of the Core Data model file did the trick. I changed it to an older version and then back. This question helped me think of this as something to try. Using mergedModelFromBundles: and versioning (CoreData) Still not sure what the root problem is.
[ANOTHER UPDATE]
I put a file monitor on the .xccurrentversion file in my Core Data momd file bundle to observe when the file is being touched. I've noticed that XCode (or some build tool) updates the .xccurrentversion file periodically when XCode comes to foreground (either when the project is opened or when it's been in background for a while). When it did this today it updated the file setting _XCCurrentVersionName to the main momd file bundle rather than the version file. I replaced the .xccurrentversion file with an older version and it launched. This would explain why reseting the current model version fixes this issue. I have no idea what the conditions are for XCode to update this file.
We ship a config file as a part of our installation that we create via install4j. Suppose the user is doing an upgrade installation when we ship a new version of the product. Is there any way to determine if the user has manually modified the file after last installation ??
We need to detect if the user has modified this file, and then merge the changes that the user has done with the new changes that we are introducing by the update.
Any pointers / ideas would be greatly appreciated.
TIA
As of 5.1.11, install4j does not support this kind of content-based modification detection. Modification detection only takes file modification times into account.
Windows installer compares a file's create and modify dates. If they are different the file has changed.
I believe you can solve this in a better way by writing the config file using the main application executable using "internal defaults" in your application instead of a base config file delivered via your setup. You can then re-apply all internal defaults to the existing file, add any new updates whilst keeping user changes where possible (sometimes you want to override what has been changed?).
The more intelligent an application is in its configuration and maintenance of settings, the less deployment problems you will see.