Package de.innovationgate.webgate.api

Examples of de.innovationgate.webgate.api.WGDatabase.openSession()


            return null;
        }

       
        if (!db.isSessionOpen()) {
            db.openSession();
        }

        return db;

    }
View Full Code Here


        design.setTitle(database.getTitle());
        design.setDescription("Design from database \"" + database.getTitle() + "\"");
       
        if (!database.isSessionOpen()) {
            try {
                database.openSession();
                WGFileContainer con = database.getFileContainer("system");
                if (con != null && con.getFileNames().contains(SystemContainerManager.CSCONFIG_FILE)) {
                    InputStream in = con.getFileData(SystemContainerManager.CSCONFIG_FILE);
                    design.setConfig(CSConfig.load(in, true));
                }
View Full Code Here

      try {
                String taskDescr = "TMLScript Master Action: " + getActionID();
               
                // Open database in master thread
                WGDatabase db = _context.getdocument().getDatabase();
          db.openSession();
                db.getSessionContext().setTask(taskDescr);
               
                // Eventually open pers db too so profile is available
                TMLUserProfile profile = _context.getprofile();
               
View Full Code Here

                // Eventually open pers db too so profile is available
                TMLUserProfile profile = _context.getprofile();
               
                if (profile != null && !profile.getprofile().getDatabase().isSessionOpen()) {
                    WGDatabase persDB = profile.getprofile().getDatabase();
                    persDB.openSession();
                    persDB.getSessionContext().setTask(taskDescr);
                }

        if (isDefaultAction()) {
          _returnValue = _context.callDefaultAction(_defaultAction, _params);
View Full Code Here

                            // request
                            requests.add(request);
                            continue;
                        }

                        if (!db.isSessionOpen() && db.openSession() == WGDatabase.ACCESSLEVEL_NOTLOGGEDIN) {
                            _core.getLog().info(
                                    "Indexer cannot access database '" + request.getDbkey() + "'. Indexing requests for content " + request.getDocumentKey()
                                            + " will be tried again later.");
                            info.requestReinserted();
                            // put request back in list and continue with next
View Full Code Here

                        } else {
                            // db session is open - ensure not more than <MaxDocsPerDBSession> docs are indexed within this session to ensure gc of hibernate-entities
                            // @see Bugfix: B000037EA
                            if (docsWithinThisSession >= getMaxDocsPerDBSession()) {
                                db.reopenSession();                               
                                if (!db.isSessionOpen() && db.openSession() == WGDatabase.ACCESSLEVEL_NOTLOGGEDIN) {
                                    _core.getLog().info(
                                            "Indexer cannot access database '" + request.getDbkey() + "'. Indexing requests for content " + request.getDocumentKey()
                                                    + " will be tried again later.");
                                    info.requestReinserted();
                                    // put request back in list and continue with next
View Full Code Here

                        continue;
                    }
                   
                    int access = WGDatabase.ACCESSLEVEL_NOTLOGGEDIN;
                    if (!db.isSessionOpen()) {
                        access = db.openSession();
                    } else {
                        access = db.getSessionContext().getAccessLevel();
                    }
                    if ( access == WGDatabase.ACCESSLEVEL_NOTLOGGEDIN ) {                   
                        _core.getLog().warn("Cannot update lucene index for database '" + request.getDbkey() + "' because it cannot be opened by master login. Indexing request will be tried again later.");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.