Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-55715

Upgrade to 6.2: ORA-01000: maximum open cursors in v6_1_1.UpgradeDocumentLibrary

    Details

    • Branch Version/s:
      6.2.x
    • Backported to Branch:
      Committed
    • Story Points:
      1.25
    • Fix Priority:
      4
    • Databases:
      Oracle Database 10.1, Oracle Database 10.2, Oracle Database 11.1, Oracle Database 11.2

      Description

      Steps to reproduce it

      1. Startup a 6.0.x version using Oracle as database (6.0.12 for example)
      2. Execute the following script to create a set of documents (go to control panel/server administration/script and select Groovy):
        import java.io.File;
        
        import com.liferay.portal.kernel.exception.PortalException;
        import com.liferay.portal.kernel.exception.SystemException;
        import com.liferay.portal.kernel.util.StringPool;
        import com.liferay.portal.service.ServiceContext;
        import com.liferay.portlet.documentlibrary.model.DLFolder;
        import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil;
        import com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil;
        
        long userId=10178;
        long groupId=10162;
        
        DLFolder folder = DLFolderLocalServiceUtil.addFolder(userId, groupId, 0, "TestFolder", StringPool.BLANK, new ServiceContext());
        
        for (int i=0;i<1000;i++) {
        	for (int j=0;j<2;j++) {
        		ServiceContext sc = new ServiceContext();
        		sc.setAttribute("extension", "txt");
        
        		String title = "TestTitle" + i;
        		String name = "TestName" + i + "v" + j + ".txt";
        		
        		if (j == 0){
        			title += ".txt";
        		}
        		
        		File file = new File("startup.sh");
        		
        		DLFileEntryLocalServiceUtil.addFileEntry(
        			userId, groupId, folder.getFolderId(), name, title, 
        			StringPool.BLANK, StringPool.BLANK, StringPool.BLANK, file, sc);
        	}
        }
        

        (please, set the variables userId and groupId properly for your environment. Notes: This script has been tested only in 6.0.12)

      3. Shutdown the portal
      4. Startup a 6.2 Server pointing to the previous database (configure it properly to perform an upgrade)

      You will get the following exception which stops the server suddenly:

      16:36:05,705 INFO  [localhost-startStop-1][UpgradeProcess:164] Upgrading com.liferay.portal.upgrade.v6_1_1.UpgradeDocumentLibrary
      16:38:14,027 ERROR [localhost-startStop-1][MainServlet:212] com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLException: ORA-01000: maximum open cursors exceeded_ [Sanitized]
      com.liferay.portal.kernel.events.ActionException: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLException: ORA-01000: maximum open cursors exceeded_ [Sanitized]
      	at com.liferay.portal.events.StartupAction.run(StartupAction.java:79)
      	at com.liferay.portal.servlet.MainServlet.processStartupEvents(MainServlet.java:1245)
      	at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:209)
      	at javax.servlet.GenericServlet.init(GenericServlet.java:160)
      	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
      	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
      	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
      	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
      	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
      	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
      	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
      	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:656)
      	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1635)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLException: ORA-01000: maximum open cursors exceeded_ [Sanitized]
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:170)
      	at com.liferay.portal.upgrade.UpgradeProcessUtil._upgradeProcess(UpgradeProcessUtil.java:162)
      	at com.liferay.portal.upgrade.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:114)
      	at com.liferay.portal.upgrade.UpgradeProcessUtil.upgradeProcess(UpgradeProcessUtil.java:94)
      	at com.liferay.portal.events.StartupHelper.upgradeProcess(StartupHelper.java:138)
      	at com.liferay.portal.events.StartupHelperUtil.upgradeProcess(StartupHelperUtil.java:61)
      	at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:143)
      	at com.liferay.portal.events.StartupAction.doRun(StartupAction.java:180)
      	at com.liferay.portal.ee.license.StartupAction.doRun(Unknown Source)
      	at com.liferay.portal.events.StartupAction.run(StartupAction.java:73)
      	... 19 more
      Caused by: com.liferay.portal.kernel.upgrade.UpgradeException: java.sql.SQLException: ORA-01000: maximum open cursors exceeded_ [Sanitized]
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:170)
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:184)
      	at com.liferay.portal.upgrade.UpgradeProcess_6_1_1.doUpgrade(UpgradeProcess_6_1_1.java:38)
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:167)
      	... 28 more
      Caused by: java.sql.SQLException: ORA-01000: maximum open cursors exceeded_ [Sanitized]
      	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
      	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
      	at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
      	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
      	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
      	at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
      	at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
      	at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1044)
      	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)
      	at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3584)
      	at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3665)
      	at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1352)
      	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:147)
      	at com.liferay.portal.upgrade.v6_1_1.UpgradeDocumentLibrary.updateFileEntries(UpgradeDocumentLibrary.java:130)
      	at com.liferay.portal.upgrade.v6_1_1.UpgradeDocumentLibrary.doUpgrade(UpgradeDocumentLibrary.java:34)
      	at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:167)
      	... 31 more
      Stopping the server due to unexpected startup errors
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              haoliang.wu Haoliang Wu (Inactive)
              Reporter:
              alberto.chaparro Alberto Chaparro
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                4 years, 37 weeks ago

                  Packages

                  Version Package
                  6.2.4 CE GA5
                  6.2.X EE
                  7.0.0 M7