Exemplo n.º 1
0
 public virtual void forceTotalTimes(int paramInt)
 {
     if (SwingUtilities.EventDispatchThread)
     {
         this.o_totalTimes          = paramInt;
         this.o_timeToInvoke        = 1;
         this.o_progressBar.Minimum = 0;
         this.o_progressBar.Maximum = paramInt;
     }
     else
     {
         try
         {
             SwingUtilities.invokeAndWait(new ForceTotalTimes(this, paramInt));
         }
         catch (InterruptedException interruptedException)
         {
             Console.WriteLine(interruptedException.ToString());
             Console.Write(interruptedException.StackTrace);
         }
         catch (InvocationTargetException invocationTargetException)
         {
             Console.WriteLine(invocationTargetException.ToString());
             Console.Write(invocationTargetException.StackTrace);
         }
     }
 }
Exemplo n.º 2
0
 /**
  * Initialize the applet.
  * As recommended, the actual use of Swing components takes place in the
  * event-dispatching thread.
  */
 public void init()
 {
     try
     {
         SwingUtilities.invokeAndWait(this);
     }
     catch             //(Exception e)
     {
         //System.err.println("Initialization failure");
     }
 }
Exemplo n.º 3
0
        }         //GEN-LAST:event_cbFileTraceActionPerformed

        // TODO does fireTableDataChanged need to be in the swing thread?
        // if not we could just call fireTableDataChanged(); from the logging functions
        public override void run()
        {
            ThreadStart refresher = () =>
            {
                if (sortRequired)
                {
                    sortRequired = false;
                    sortLists();
                }

                // Scroll to bottom of the tables
                int max = jScrollPane1.VerticalScrollBar.Maximum;
                jScrollPane1.VerticalScrollBar.Value = max;

                max = jScrollPane2.VerticalScrollBar.Maximum;
                jScrollPane2.VerticalScrollBar.Value = max;

                // Tell the tables to redraw
                fileHandleModel.fireTableDataChanged();
                fileCommandModel.fireTableDataChanged();
            };

            while (true)
            {
                try
                {
                    lock (this)
                    {
                        while (!dirty)
                        {
                            Monitor.Wait(this);
                        }
                        dirty = false;
                    }

                    if (Instance.Visible)
                    {
                        SwingUtilities.invokeAndWait(refresher);
                    }

                    // Cap update frequency
                    Thread.Sleep(200);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.ToString());
                    Console.Write(e.StackTrace);
                }
            }
        }
Exemplo n.º 4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void unloadDB() throws Exception
        public override void unloadDB()
        {
            if (syncToEventDispatch && !SwingUtilities.EventDispatchThread)
            {
                this.o_retException = null;
                SwingUtilities.invokeAndWait(new RunnableAnonymousInnerClass2(this));
                if (this.o_retException != null)
                {
                    throw this.o_retException;
                }
                return;
            }
            try
            {
                this.b_isDBLoaded = false;
                Properties properties = new Properties();
                properties.setProperty("user", "SA");
                properties.setProperty("password", "");
                properties.setProperty("shutdown", "true");
                Connection connection = DriverManager.getConnection("jdbc:hsqldb:" + installDir + "project/" + this.o_projectFolderName + "/projectDB", properties);
                if (!connection.AutoCommit)
                {
                    connection.commit();
                }
                if (this.o_sessionFactory != null)
                {
                    try
                    {
                        currentSession().beginTransaction().commit();
                        closeSession();
                    }
                    catch (Exception exception)
                    {
                        Console.WriteLine(exception.ToString());
                        Console.Write(exception.StackTrace);
                    }
                }
                foreach (Session session in this.aliveSessions)
                {
                    if (session.Open)
                    {
                        try
                        {
                            if (session.Transaction != null && session.Transaction.Active)
                            {
                                session.Transaction.commit();
                            }
                            session.flush();
                        }
                        catch (Exception exception)
                        {
                            Console.WriteLine(exception.ToString());
                            Console.Write(exception.StackTrace);
                        }
                        try
                        {
                            session.close();
                        }
                        catch (Exception exception)
                        {
                            Console.WriteLine(exception.ToString());
                            Console.Write(exception.StackTrace);
                        }
                    }
                }
                this.aliveSessions.Clear();
                if (this.o_sessionFactory != null && !this.o_sessionFactory.Closed)
                {
                    try
                    {
                        this.o_sessionFactory.close();
                    }
                    catch (Exception exception)
                    {
                        Console.WriteLine(exception.ToString());
                        Console.Write(exception.StackTrace);
                    }
                }
                this.o_session        = null;
                this.o_sessionFactory = null;
                Statement statement = connection.createStatement();
                statement.execute("SHUTDOWN");
                statement.close();
                connection.close();
            }
            catch (Exception exception)
            {
                Console.WriteLine("Could not shutdown Database dont save Project:\n " + exception.Message);
                throw exception;
            }
        }
Exemplo n.º 5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void loadDB() throws Exception
        public override void loadDB()
        {
            if (DBLoaded)
            {
                return;
            }
            if (syncToEventDispatch && !SwingUtilities.EventDispatchThread)
            {
                this.o_retException = null;
                SwingUtilities.invokeAndWait(new RunnableAnonymousInnerClass(this));
                if (this.o_retException != null)
                {
                    throw this.o_retException;
                }
                return;
            }
            if (this.o_properties != null && !string.ReferenceEquals(this.o_properties.PreviousVersion, null))
            {
                if (this.o_properties.isOlderVersionFrom(this.o_properties.PreviousVersion, "4.0.1"))
                {
                    Console.WriteLine("Deleting indexes prior to 4.0.1 from version " + this.o_properties.PreviousVersion);
                    try
                    {
                        Console.WriteLine("deleting: " + new File(installDir + "project/" + this.o_projectFolderName + "/indexBase"));
                        deleteDirectory(new File(installDir + "project/" + this.o_projectFolderName + "/indexBase"));
                    }
                    catch (Exception exception)
                    {
                        Console.WriteLine(exception.ToString());
                        Console.Write(exception.StackTrace);
                    }
                }
                if (this.o_properties.isOlderVersionFrom(this.o_properties.PreviousVersion, "4.2.7"))
                {
                    Properties properties = new Properties();
                    properties.setProperty("user", "SA");
                    properties.setProperty("password", "");
                    properties.setProperty("shutdown", "true");
                    initDriver(HSQL_DBMS);
                    Connection connection = DriverManager.getConnection("jdbc:hsqldb:" + installDir + "project/" + this.o_projectFolderName + "/projectDB", properties);
                    if (!connection.AutoCommit)
                    {
                        connection.commit();
                    }
                    Statement statement = connection.createStatement();
                    try
                    {
                        Console.WriteLine("Renaming the Condition Table to CNDON...");
                        statement.execute("DROP TABLE IF EXISTS CNDON");
                        statement.execute("ALTER TABLE CONDITION RENAME TO CNDON");
                        Console.WriteLine("OK!");
                    }
                    catch (Exception exception)
                    {
                        Console.WriteLine(exception.ToString());
                        Console.Write(exception.StackTrace);
                        Console.WriteLine("TABLE WITH NAME CONDITION NOT FOUND!");
                    }
                    statement.close();
                    connection.close();
                }
                if (this.o_properties.isOlderVersionFrom(this.o_properties.PreviousVersion, "4.6.0"))
                {
                    Properties properties = new Properties();
                    properties.setProperty("user", "SA");
                    properties.setProperty("password", "");
                    properties.setProperty("shutdown", "true");
                    initDriver(HSQL_DBMS);
                    Connection connection = DriverManager.getConnection("jdbc:hsqldb:" + installDir + "project/" + this.o_projectFolderName + "/projectDB", properties);
                    if (!connection.AutoCommit)
                    {
                        connection.commit();
                    }
                    Statement statement = connection.createStatement();
                    try
                    {
                        Console.WriteLine("Updating data integrity...");
                        statement.execute("ALTER TABLE BOQITEM ALTER COLUMN DESCRIPTION LONGVARCHAR");
                        statement.execute("ALTER TABLE BOQITEM ALTER COLUMN NOTES LONGVARCHAR");
                        statement.execute("ALTER TABLE EQUIPMENT ALTER COLUMN DESCRIPTION LONGVARCHAR");
                        statement.execute("ALTER TABLE EQUIPMENT ALTER COLUMN NOTES LONGVARCHAR");
                        statement.execute("ALTER TABLE ASSEMBLY ALTER COLUMN DESCRIPTION LONGVARCHAR");
                        statement.execute("ALTER TABLE ASSEMBLY ALTER COLUMN NOTES LONGVARCHAR");
                        statement.execute("ALTER TABLE MATERIAL ALTER COLUMN DESCRIPTION LONGVARCHAR");
                        statement.execute("ALTER TABLE MATERIAL ALTER COLUMN NOTES LONGVARCHAR");
                        statement.execute("ALTER TABLE SUBCONTRACTOR ALTER COLUMN DESCRIPTION LONGVARCHAR");
                        statement.execute("ALTER TABLE SUBCONTRACTOR ALTER COLUMN NOTES LONGVARCHAR");
                        statement.execute("ALTER TABLE QUOTEITEM ALTER COLUMN TITLE LONGVARCHAR");
                        Console.WriteLine("OK!");
                    }
                    catch (Exception)
                    {
                    }
                    statement.close();
                    connection.close();
                }
            }
            closeSession();
            this.o_configuration = new Configuration();
            this.o_configuration.configure(configXML);
            ISet <object> set = this.o_configuration.Properties.Keys;

            string[] arrayOfString = (string[])set.toArray(new string[set.Count]);
            foreach (string str in arrayOfString)
            {
                if (str.IndexOf("search.default", StringComparison.Ordinal) != -1)
                {
                    this.o_configuration.Properties.remove(str);
                }
            }
            this.o_configuration.setProperty("hibernate.connection.isolation", "1");
            this.o_configuration.setProperty("hibernate.cache.jdbc.batch_size", "50");
            this.o_configuration.setProperty("hibernate.cache.use_second_level_cache", "false");
            this.o_configuration.setProperty("hibernate.cache.use_query_cache", "false");
            this.o_configuration.setProperty("hibernate.cache.provider_class", "org.hibernate.cache.NoCacheProvider");
            this.o_configuration.setProperty("hibernate.search.indexing_strategy", "manual");
            this.o_configuration.setProperty("hibernate.search.autoregister_listeners", "false");
            this.o_configuration.setProperty("hibernate.temp.use_jdbc_metadata_defaults", "false");
            this.o_configuration.registerTypeOverride(new CostOSString256Type(), new string[] { "costos_string" });
            this.o_configuration.registerTypeOverride(new CostOSTextType());
            this.o_configuration.registerTypeOverride(new UnitAliasType(ProjectGroupCodesProvider, "unit_alias"));
            for (sbyte b = 1; b <= 9; b++)
            {
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)10, b, "eps_level" + b + "_code", (short)2));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)-1, b, "wbs1_level" + b + "_code", (short)2));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)-2, b, "wbs2_level" + b + "_code", (short)2));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)-3, b, "location_level" + b + "_code", (short)2));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)-4, b, "paramitem_level" + b + "_code", (short)2));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)10, b, "eps_level" + b + "_title", (short)0));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)-1, b, "wbs1_level" + b + "_title", (short)0));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)-2, b, "wbs2_level" + b + "_title", (short)0));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)-3, b, "location_level" + b + "_title", (short)0));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)-4, b, "paramitem_level" + b + "_title", (short)0));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)-1, b, "wbs1_level" + b + "_item_code", (short)5));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)-2, b, "wbs2_level" + b + "_item_code", (short)5));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)-1, b, "wbs1_level" + b + "_unit", (short)4));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)-2, b, "wbs2_level" + b + "_unit", (short)4));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)-1, b, "wbs1_level" + b + "_qty", (short)6));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)-2, b, "wbs2_level" + b + "_qty", (short)6));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)1, b, "groupcode1_level" + b + "_code", (short)2));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)2, b, "groupcode2_level" + b + "_code", (short)2));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)3, b, "groupcode3_level" + b + "_code", (short)2));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)4, b, "groupcode4_level" + b + "_code", (short)2));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)5, b, "groupcode5_level" + b + "_code", (short)2));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)6, b, "groupcode6_level" + b + "_code", (short)2));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)7, b, "groupcode7_level" + b + "_code", (short)2));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)8, b, "groupcode8_level" + b + "_code", (short)2));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)9, b, "groupcode9_level" + b + "_code", (short)2));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)1, b, "groupcode1_level" + b + "_title", (short)0));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)2, b, "groupcode2_level" + b + "_title", (short)0));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)3, b, "groupcode3_level" + b + "_title", (short)0));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)4, b, "groupcode4_level" + b + "_title", (short)0));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)5, b, "groupcode5_level" + b + "_title", (short)0));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)6, b, "groupcode6_level" + b + "_title", (short)0));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)7, b, "groupcode7_level" + b + "_title", (short)0));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)8, b, "groupcode8_level" + b + "_title", (short)0));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)9, b, "groupcode9_level" + b + "_title", (short)0));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)1, b, "groupcode1_level" + b + "_description", (short)1));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)2, b, "groupcode2_level" + b + "_description", (short)1));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)3, b, "groupcode3_level" + b + "_description", (short)1));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)4, b, "groupcode4_level" + b + "_description", (short)1));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)5, b, "groupcode5_level" + b + "_description", (short)1));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)6, b, "groupcode6_level" + b + "_description", (short)1));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)7, b, "groupcode7_level" + b + "_description", (short)1));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)8, b, "groupcode8_level" + b + "_description", (short)1));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)9, b, "groupcode9_level" + b + "_description", (short)1));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)1, b, "groupcode1_level" + b + "_unit", (short)4));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)2, b, "groupcode2_level" + b + "_unit", (short)4));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)3, b, "groupcode3_level" + b + "_unit", (short)4));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)4, b, "groupcode4_level" + b + "_unit", (short)4));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)5, b, "groupcode5_level" + b + "_unit", (short)4));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)6, b, "groupcode6_level" + b + "_unit", (short)4));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)7, b, "groupcode7_level" + b + "_unit", (short)4));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)8, b, "groupcode8_level" + b + "_unit", (short)4));
                this.o_configuration.registerTypeOverride(new GroupCodeType(ProjectGroupCodesProvider, (short)9, b, "groupcode9_level" + b + "_unit", (short)4));
            }
            this.o_configuration.setListener("post-update", null);
            this.o_configuration.setListener("post-insert", null);
            this.o_configuration.setListener("post-delete", null);
            this.o_configuration.setProperty("hibernate.connection.url", "jdbc:hsqldb:" + installDir + "project/" + this.o_projectFolderName + "/projectDB;hsqldb.write_delay=false");
            this.o_sessionFactory = this.o_configuration.buildSessionFactory();
            Session session = currentSession();

            if (ProjectSchemaUpdateUtil.checkRequiresProjectIdUpdates(this))
            {
                ProjectSchemaUpdateUtil.processProjectIdUpdates(this);
            }
            closeSession();
            ProjectDBUtil projectDBUtil;

            (projectDBUtil = ProjectDBUtil.currentProjectDBUtil()).CurrentProjectDBUtil = this;
            File file = new File(installDir + "project" + File.separator + this.o_projectFolderName + File.separator + "projectDB.details");

            if (!file.exists())
            {
                this.b_isDBLoaded = true;
                if (this.o_properties == null)
                {
                    this.o_properties = new ProjectDBProperties(this, true);
                }
                else
                {
                    this.o_properties.reloadProperties();
                }
                if (!string.ReferenceEquals(this.o_properties.PreviousVersion, null))
                {
                    updateNewerDatabase();
                }
                ProjectGroupCodesProvider.initializeProjectCaches();
            }
            ProjectDBUtil.CurrentProjectDBUtil = projectDBUtil;
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void unloadDB() throws Exception
        public override void unloadDB()
        {
            if (syncToEventDispatch && !SwingUtilities.EventDispatchThread)
            {
                this.o_retException = null;
                SwingUtilities.invokeAndWait(new RunnableAnonymousInnerClass2(this));
                if (this.o_retException != null)
                {
                    throw this.o_retException;
                }
                return;
            }
            try
            {
                if (DBLoaded)
                {
                    try
                    {
                        currentSession().beginTransaction().commit();
                        closeSession();
                    }
                    catch (Exception exception)
                    {
                        Console.WriteLine(exception.ToString());
                        Console.Write(exception.StackTrace);
                    }
                }
                this.b_isDBLoaded = false;
                foreach (Session session in this.aliveSessions)
                {
                    if (session.Open)
                    {
                        try
                        {
                            if (session.Transaction != null && session.Transaction.Active)
                            {
                                session.Transaction.commit();
                            }
                            session.flush();
                        }
                        catch (Exception exception)
                        {
                            Console.WriteLine(exception.ToString());
                            Console.Write(exception.StackTrace);
                        }
                        try
                        {
                            session.close();
                        }
                        catch (Exception exception)
                        {
                            Console.WriteLine(exception.ToString());
                            Console.Write(exception.StackTrace);
                        }
                    }
                }
                this.aliveSessions.Clear();
                if (this.o_sessionFactory != null && !this.o_sessionFactory.Closed)
                {
                    this.o_sessionFactory.close();
                }
                this.o_session        = null;
                this.o_sessionFactory = null;
            }
            catch (Exception exception)
            {
                Console.WriteLine("Could not shutdown Database dont save Project:\n " + exception.Message);
                throw exception;
            }
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void loadDB() throws Exception
        public override void loadDB()
        {
            if (DBLoaded)
            {
                return;
            }
            if (syncToEventDispatch && !SwingUtilities.EventDispatchThread)
            {
                this.o_retException = null;
                loadDB();
                SwingUtilities.invokeAndWait(new RunnableAnonymousInnerClass(this));
                if (this.o_retException != null)
                {
                    throw this.o_retException;
                }
                return;
            }
            closeSession();
            this.dbmsType = this.o_urlTable.Dbms.Value;
            if (this.requiresAlters)
            {
                this.o_configuration = ProjectSessionFactoryBuilder.Instance.createConfigurationFromUrl(configXML, this.o_urlTable, ProjectGroupCodesProvider, this.requiresAlters, this.o_urlTable.TablePrefix);
                long l = DateTimeHelper.CurrentUnixTimeMillis();
                Console.WriteLine("  BUILDING SESSION FACTORY...");
                this.o_sessionFactory = this.o_configuration.buildSessionFactory();
                Console.WriteLine("DONE IN: " + ((DateTimeHelper.CurrentUnixTimeMillis() - l) / 1000L));
            }
            else
            {
                if (ProjectSessionFactory.GroupCodesProvider == null)
                {
                    ProjectSessionFactory.UpGroupCodesProvider = s_providerFactory.createSharedFactory();
                }
                this.sharedGroupCodesProvider = (ProjectGroupCodesProvider)ProjectSessionFactory.GroupCodesProvider;
                long l = DateTimeHelper.CurrentUnixTimeMillis();
                Console.WriteLine("  GETTING SESSION FACTORY...");
                this.o_configuration  = ProjectSessionFactory.getConfiguration(this.dbmsType);
                this.o_sessionFactory = ProjectSessionFactory.getSessionFactory(this.dbmsType);
                Console.WriteLine("DONE IN: " + ((DateTimeHelper.CurrentUnixTimeMillis() - l) / 1000L));
            }
            currentSession();
            closeSession();
            this.b_isDBLoaded = true;
            ProjectDBUtil projectDBUtil;

            (projectDBUtil = ProjectDBUtil.currentProjectDBUtil()).CurrentProjectDBUtil = this;
            if (this.o_properties == null)
            {
                this.o_properties = new ProjectDBProperties(this, true);
            }
            else
            {
                this.o_properties.reloadProperties();
            }
            if (!string.ReferenceEquals(this.o_properties.PreviousVersion, null) && this.requiresAlters && !(s_providerFactory is nomitech.ces.utils.DummyProjectGroupCodesProviderFactory))
            {
                updateNewerDatabase();
            }
            if (this.sharedGroupCodesProvider == null)
            {
                ProjectGroupCodesProvider.initializeProjectCaches();
            }
            else
            {
                ((WBSCache)Wbs1Cache).initCache();
                ((WBS2Cache)Wbs2Cache).initCache();
                try
                {
                    ((ParamItemCache)ParamItemCache).initializeCache();
                }
                catch (Exception exception)
                {
                    Console.WriteLine(exception.ToString());
                    Console.Write(exception.StackTrace);
                }
            }
            ProjectVariableCache.initCache();
            ProjectDBUtil.CurrentProjectDBUtil = projectDBUtil;
        }