|
Re: [CDO] Should Audit validate the timestamp on instantiation? [message #423471 is a reply to message #423426] |
Tue, 30 September 2008 16:14 |
|
Hi André,
You're right, the behaviour should be the same for session.openAudit()
and audit.setTimeStamp(). Please file a Bugzilla for this one so that we
can track it. Btw. I think the timeStamp must be validated by the
repository (as is done in setTimeStamp) because all time stamps are
always repository-scoped.
The ReadOnlyException looks like a separate bug and I wonder hy we
haven't seen it in the tests. Can you file a separate Bugzilla and
attach your test case?
Thank you
/Eike
André Dietisheim schrieb:
> I noticed the following behaviour when playing around with audits
> (denoted by pesudo-code):
>
> createSomeRepo();
> createSomeSession();
> session.openAudit(1911-11-11);
>
> -> accepted! An exception (ReadonlyException) gets triggered later on,
> as soon as I try to get the corresponding resource.
>
> createSomeRepo();
> createSomeSession();
> session.openAudit(timeStampAfterRepoCreation);
> audit.setTimeStamp(1911-11-11)
>
> -> IllegalArgumentException (timeStamp < repository creation time)
>
> My guess is that the timestamp used when instantiating an Audit
> (CDOSession#openAudit(long timestamp)) should be validated in the
> Audit constructor. If I'm wrong here it's still confusing to me to
> allow timestamps prior to repository creation when setting the
> timestamp when creating the audit while disallowing it when setting it
> by setTimeStamp().
> The ReadonlyException showed above occurs because a new resource gets
> added to the resourceset, the CDOViewSet gets notified of it and tries
> to attach it to the audit:
>
> CDOViewSetImpl:
>
> private void notifyAdd(CDOResourceImpl resourceImpl)
> {
> CDOViewImpl view = resolveUUID(resourceImpl.getURI().authority());
> if (view != null && FSMUtil.isTransient(resourceImpl))
> {
> view.toTransaction().attach(resourceImpl);
> }
> }
>
>
> Am I right? Shall I post a bugzilla? I have a supplementary test for
> AuditTest and I could try tp patch CDOAuditImpl.
>
> Cheers
> André
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
Powered by
FUDForum. Page generated in 0.03371 seconds