Package org.exoplatform.services.jcr.impl.storage.jdbc

Examples of org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnection$ExtendedTempPropertyData


      {
         // avoid unnecessary request to database
         return new ArrayList<NodeDataIndexing>();
      }

      JDBCStorageConnection conn = (JDBCStorageConnection)connFactory.openConnection();
      try
      {
         int currentOffset;
         String currentLastNodeId;
         int currentPage;
         synchronized (this)
         {
            currentOffset = offset.getAndAdd(pageSize);
            currentLastNodeId = lastNodeId.get();
            currentPage = page.incrementAndGet();
         }
         long time = 0;
         if (PropertyManager.isDevelopping())
         {
            time = System.currentTimeMillis();
         }
         List<NodeDataIndexing> result = conn.getNodesAndProperties(currentLastNodeId, currentOffset, pageSize);
         if (PropertyManager.isDevelopping())
         {
            LOG.info("Page = " + currentPage + " Offset = " + currentOffset + " LastNodeId = '" + currentLastNodeId
               + "', query time = " + (System.currentTimeMillis() - time) + " ms, from '"
               + (result.isEmpty() ? "unknown" : result.get(0).getIdentifier()) + "' to '"
               + (result.isEmpty() ? "unknown" : result.get(result.size() - 1).getIdentifier()) + "'");
         }
         hasNext.compareAndSet(true, result.size() == pageSize);
         if (hasNext() && connFactory.isIDNeededForPaging())
         {
            synchronized (this)
            {
               lastNodeId.set(result.get(result.size() - 1).getIdentifier());              
               offset.set((page.get() - currentPage) * pageSize);           
            }           
         }
        
         return result;
      }
      finally
      {
         conn.close();
      }
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnection$ExtendedTempPropertyData

Copyright © 2018 www.massapicom. 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.