3 Replies Latest reply on Oct 13, 2006 11:22 PM by 413724

    How to clean are server data before restart of Web App?

    413724
      Hi,

      JDev 10.1.3

      ADF stores row currency data, uncommited data, etc ... on the server.
      Now when the I change the source of the application, most of the time model classes, when I restart the embedded OCJ4 server, I get unexpected errors sometimes Application Pool errors.
      I have to restart the application several times it works as expected.

      My question:
      Is there a way to tell the embedded OC4J server to clean all session data before restarting?
      How does it work on a production OC4J server version?

      PS I'm going into production soon.

      Thanks

      Fred
        • 1. Re: How to clean are server data before restart of Web App?
          Frank Nimphius-Oracle
          Hi,

          when you stop and start the embedded server then all session dada is lost. Don't know where the error messages are coming from. You can run teh same test with stand alone OC4J and you should see that things don't cache between OC4J starts

          Frank
          • 2. Re: How to clean are server data before restart of Web App?
            413724
            Maybe my problem has to with by bind variable setting see thread:
            HELP: VO Bind variable gets lost, VO passivation checked!
            but I don't think.

            I restarted my Web app. without closing my Firefox browser, my app. creates a new HttpSession if the previous was invalid.

            I use the same navigation flow and I get following exception when following method gets called:
            As if the VO was empty?
            => passivation flag set no rollback no reset/revert/clearcache called in the flow!
                System.out.println(getClass().getName()+".onSetCurrentRowWithKey "+System.currentTimeMillis());
                HttpServletRequest req = ctx.getHttpServletRequest();
                WebAccountAM webAccountAM = (WebAccountAM) this.getApplicationModule(WebConstants.AM_WEBACCOUNT,ctx);
                Number eventId = null;
                if (webAccountAM == null) 
                 {
                  // return error
                  System.out.println(getClass().getName()+".onSetCurrentRowWithKey webAccountAM not found.");
                 }
                else 
                {
                  eventId = webAccountAM.getCurrentEventIdFromAccountOwnerList();
                  System.out.println(getClass().getName()+".onSetCurrentRowWithKey before doIt eventId: "+eventId);
                }
            //    invokeAction(ctx,"setCurrentRowWithKey");
                invokeEventAction(ctx); // replaces doIt, if NOT => no currency changed!
                eventId = webAccountAM.getCurrentEventIdFromAccountOwnerList();
                Integer page = (Integer)req.getAttribute(WebConstants.REQUEST_PAGE);
                System.out.println(getClass().getName()+".onSetCurrentRowWithKey after doIt eventId: "+eventId+", page from request: "+page);
                UserContainer userContainer = this.getUserContainer(ctx);
            //    userContainer.setCurrentManagedEventPk(req.getParameter("Arg0"));    
                ViewObject vo = webAccountAM.findViewObject("EventAccountOwnerListExtVO1");
                Row currentRow = vo.getCurrentRow();
                userContainer.setCurrentManagedEventPk(currentRow.getKey(),page); 
                short privacyType = ((Number)currentRow.getAttribute("PrivacyType")).shortValue();
                userContainer.addAccessInfoForEventOwner(eventId,privacyType);    
            Exception extract:
            oracle.jbo.RowNotFoundException: View row of key oracle.jbo.Key[41 41 48 59 ] not found in EventAccountOwnerListExtVO1Iterator.
                 at oracle.adf.model.bc4j.DCJboDataControl.setCurrentRowInRSI(DCJboDataControl.java:949)
                 at oracle.adf.model.bc4j.DCJboDataControl.setCurrentRowWithKey(DCJboDataControl.java:863)
                 at oracle.adf.model.binding.DCIteratorBinding.setCurrentRowWithKey(DCIteratorBinding.java:2833)
                 at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1252)
                 at oracle.adf.controller.lifecycle.PageLifecycle.invokeActionBinding(PageLifecycle.java:678)
                 at com.photoswing.webview.actions.BaseDataForwardAction.invokeEventAction(BaseDataForwardAction.java:610)
                 at com.photoswing.webview.actions.AccountEventsAction.onSetCurrentRowWithKey(AccountEventsAction.java:175)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at oracle.adf.controller.lifecycle.PageLifecycle.handleEvent(PageLifecycle.java:545)
                 at oracle.adf.controller.struts.actions.StrutsPageLifecycle.handleEvent(StrutsPageLifecycle.java:258)
                 at oracle.adf.controller.lifecycle.PageLifecycle.processComponentEvents(PageLifecycle.java:478)
                 at oracle.adf.controller.struts.actions.DataAction.processComponentEvents(DataAction.java:236)
                 at oracle.adf.controller.struts.actions.DataAction.processComponentEvents(DataAction.java:430)
                 at oracle.adf.controller.lifecycle.PageLifecycle.handleLifecycle(PageLifecycle.java:127)
                 at oracle.adf.controller.struts.actions.DataAction.handleLifecycle(DataAction.java:223)
                 at com.photoswing.webview.actions.BaseDataForwardAction.handleLifecycle(BaseDataForwardAction.java:240)
                 at oracle.adf.controller.struts.actions.DataAction.execute(DataAction.java:155)
                 at oracle.adf.controller.v2.struts.actions.DataAction.execute(DataAction.java:104)
                 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
                 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
                 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
                 at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:434)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
                 at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
                 at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
                 at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332)
                 at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
                 at com.photoswing.filter.LocaleFilter.doFilter(LocaleFilter.java:318)
                 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)
                 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
                 at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
                 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
                 at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
                 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
                 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
                 at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
                 at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
                 at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)
                 at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
                 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
                 at java.lang.Thread.run(Thread.java:595)
            I rerun the App again (right click on project) without closing Firefox and running app and this error disappears.
            I hope it's a coding error but if it is it will be difficult to find.

            Thanks for your time

            Fred
            • 3. Re: How to clean are server data before restart of Web App?
              413724
              For your information:

              I get the same exception when I log off => invalidate HTTPSession and log in again with same flow => new HTTPSession.

              In this case I suspect that some values and VO currencies are kept in Application Pool and between two different HTTPSession ??

              Is there any AM Pool passivated data reused between 2 different HTTPSession and even when the App. is restarted.

              I remind you that firefox is my default browser and when the App is restarted a new tab is opened in the same browser instance.
              So if any cookies not bound to HttpSession for a site exists (is this possible??) they will still be active.

              Thanks

              Fred