Menu

copyToDatabase() encounter an Exception

2010-03-12
2013-06-03
  • Nobody/Anonymous

        ConsoleMonitor monitor = new ConsoleMonitor();
            DNotesFactory factory = DNotesFactory.getInstance(
                    "de.bea.domingo.service.NotesServiceFactory",monitor);
            DSession session = factory.getSession("192.9.100.66", "Administrator", "admin");
            DDatabase zbDatabase = session.getDatabase("notes-test", "gzzb.nsf");
            Iterator<?> it = zbDatabase.getAllDocuments();
            DDocument document = (DDocument) it.next();
            for(int i=0;i<6000;i++) {
                document.copyToDatabase(zbDatabase);
            }
    
    de.bea.domingo.service.NotesServiceRuntimeException: de.bea.domingo.proxy.DocumentProxy: Cannot get universalID
        at de.bea.domingo.service.NotesServiceFactory.invoke(NotesServiceFactory.java:382)
        at de.bea.domingo.service.NotesInvocationHandler.invoke(NotesInvocationHandler.java:87)
        at $Proxy3.copyToDatabase(Unknown Source)
        at com.trs.gateway.domino.DomingoTest.main(DomingoTest.java:40)
    Caused by: de.bea.domingo.proxy.NotesProxyRuntimeException: de.bea.domingo.proxy.DocumentProxy: Cannot get universalID
        at de.bea.domingo.proxy.BaseProxy.newRuntimeException(BaseProxy.java:655)
        at de.bea.domingo.proxy.DocumentProxy.getUniversalID(DocumentProxy.java:90)
        at de.bea.domingo.proxy.DocumentProxy.<init>(DocumentProxy.java:65)
        at de.bea.domingo.proxy.BaseDocumentProxy.getInstance(BaseDocumentProxy.java:109)
        at de.bea.domingo.proxy.DocumentProxy.copyToDatabase(DocumentProxy.java:132)
        at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at de.bea.domingo.service.InvocationTask.run(InvocationTask.java:102)
        at de.bea.domingo.threadpool.SimpleThreadPool.run(SimpleThreadPool.java:369)
        at de.bea.domingo.proxy.DNotesThread.run(DNotesThread.java:244)
    Caused by: de.bea.domingo.exception.DominoException: [4000] Error while bulk recycling objects
        at de.bea.domingo.proxy.BaseProxy.newRuntimeException(BaseProxy.java:654)
        ... 10 more
    
     
  • Nobody/Anonymous

    I see,  you should recycle the new DDocument after saved, such as:

            for (int i = 0; i < 4000; i++) {
                DDocument newDocument = document.copyToDatabase(zbDatabase);
                newDocument.recycle();
            }
    
     

Log in to post a comment.