I am doing some playing around with Slide and have a problem with using
rollback. The setup is using 2002-08-17 nightly src, built with JDK 1.4.0_01
on W2000, using HSQL DB setup as per the domain.sample file. The problem is
that if I start a transaction, add some content then rollback and check to
see if the content is still there - it is. The code snippet I am using is as
follows:

                 // make sure content is not already there
                 try {
                     revisionDescriptors = content.retrieve(slideToken, 
content2URI);
                     if (null != revisionDescriptors) {
                         System.out.println("ERROR: Content before rollback 
test");
                     }
                 } catch (ObjectNotFoundException e) {
                     // expected
                 } catch (Throwable e) {
                     e.printStackTrace();
                 }

                 // start test
                 token.begin();
                 contentSubject = new SubjectNode();
                 structure.create(slideToken, contentSubject, content2URI);

                 content.create(slideToken, content2URI, true);

                 revisionDescriptors = null;
                 revisionDescriptor = null;

                 revisionDescriptors = content.retrieve(slideToken, 
content2URI);

                 nodeRevContent = new NodeRevisionContent();

                 revisionDescriptor = new NodeRevisionDescriptor(-1);

                 revisionDescriptor.setProperty("revision", "1");
                 nodeRevContent.setContent(contentText.toCharArray());
                 content.create(slideToken, content2URI, revisionDescriptor,
                                nodeRevContent);

                 revisionDescriptors = content.retrieve(slideToken, 
content2URI);
                 if (null == revisionDescriptors) {
                     System.out.println("ERROR: no content after commit");
                 }

                 try {
                     token.rollback();
                 } catch (SystemException ex) {
                     ex.printStackTrace();
                 }

                 try {
                     revisionDescriptors = content.retrieve(slideToken, 
content2URI);
                     if (null != revisionDescriptors) {
                         System.out.println("ERROR: Content after rollback");
                     }
                 } catch (Throwable e) {
                     e.printStackTrace();
                 }

The problem is that the last content.retrieve always returns a not-null. Am
I missing something here or is rollback broken?

Robert


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to