Community
Participate
Working Groups
Build Identifier: 4.0 When creating an initial model, then immediately creating a branch, and trying to access the object on the branch, an occasional ObjectNotfoundException is thrown. This is usually the setup in testCases and might be the problem for the failed test on Hudson. The reason this happens is that the timestamp of the branch is older than the timestamp of the object on main branch, so the branchRevisionManager will return null even though it has a revision (with newer timestamp) in the cache. The cause for the branch being older than the object itself seems to be in the getTimeStamp() method of the CDOTimeProvider which will use an approximate time when createBranch on CDOBranchManager is called with CDOBranchPoint.UNSPECIFIED_DATE. Reproducible: Sometimes Steps to Reproduce: 1. create initial model. 2. immediately after create a branch. 3. access some of the model objects on branch.
Hi Pascal, I've always felt unhappy with the createBranch(String) method, the one without the timestamp parameter. It generally seems better to explicitely control the time of the base branch point. An alternative would be to determine the timestamp on the server but I tend to remove the "unexplicit" API from the client. What do you think?
I find it quite convenient to just use the createBranch method without a time parameter if I just want to create a branch "now". To be on the safe side the server should probably set the actual time for "now", but as discussed yesterday this might invole some major changes. So we might as well just remove the "unexplicit" API unless there is a good way to get a reliable last server timestamp. Maybe something like the responding time from the last refreh timeResult.
I'm going to provide a fix...
Created attachment 180406 [details] Patch v1 - for future reference
Tests run fine ;-) Committed to HEAD
Available in R20110608-1407