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

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


    */
   protected ValueData getPropertyValue(String propertyId, int orderNumb, int persistedVersion)
      throws IllegalStateException, RepositoryException
   {
      // TODO use interface not JDBC
      JDBCStorageConnection conn = (JDBCStorageConnection)dataContainer.openConnection();
      try
      {
         return conn.getValue(propertyId, orderNumb, persistedVersion);
      }
      finally
      {
         conn.close();
      }
   }
View Full Code Here


    */
   protected ValueData getPropertyValue(String propertyId, int orderNumb, int persistedVersion)
      throws IllegalStateException, RepositoryException
   {
      // TODO use interface not JDBC
      JDBCStorageConnection conn = (JDBCStorageConnection)dataContainer.openConnection();
      try
      {
         return conn.getValue(propertyId, orderNumb, persistedVersion);
      }
      finally
      {
         conn.close();
      }
   }
View Full Code Here

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

      JDBCStorageConnection conn = (JDBCStorageConnection)connFactory.openConnection();
      final boolean isOffsetSupported = connFactory.isOffsetSupported();
      try
      {
         if (!isOffsetSupported)
         {
            // The offset is not supported so we need to synchronize the access
            lock.lock();
         }
         int currentOffset;
         String currentLastNodeId;
         int currentPage;
         synchronized (this)
         {
            currentOffset = offset.getAndAdd(pageSize);
            currentLastNodeId = lastNodeId.get();
            currentPage = page.incrementAndGet();
         }
         if (!hasNext())
         {
            // avoid unnecessary request to database
            return new ArrayList<NodeDataIndexing>();
         }
         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
      {
         if (!isOffsetSupported)
         {
            // The offset is not supported so we need to synchronize the access
            lock.unlock();
         }
         conn.close();
      }
   }
View Full Code Here

      {
         // 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 = 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

    */
   protected ValueData getPropertyValue(String propertyId, int orderNumb, int persistedVersion)
      throws IllegalStateException, RepositoryException
   {
      // TODO use interface not JDBC
      JDBCStorageConnection conn = (JDBCStorageConnection)dataContainer.openConnection();
      try
      {
         return conn.getValue(propertyId, orderNumb, persistedVersion);
      }
      finally
      {
         conn.close();
      }
   }
View Full Code Here

    */
   protected ValueData getPropertyValue(String propertyId, int orderNumb, int persistedVersion)
      throws IllegalStateException, RepositoryException
   {
      // TODO use interface not JDBC
      JDBCStorageConnection conn = (JDBCStorageConnection)dataContainer.openConnection();
      try
      {
         return conn.getValue(propertyId, orderNumb, persistedVersion);
      }
      finally
      {
         conn.close();
      }
   }
View Full Code Here

    */
   protected ValueData getPropertyValue(String propertyId, int orderNumb, int persistedVersion)
      throws IllegalStateException, RepositoryException
   {
      // TODO use interface not JDBC
      JDBCStorageConnection conn = (JDBCStorageConnection)dataContainer.openConnection();
      try
      {
         return conn.getValue(propertyId, orderNumb, persistedVersion);
      }
      finally
      {
         conn.close();
      }
   }
View Full Code Here

    */
   protected ValueData getPropertyValue(String propertyId, int orderNumb, int persistedVersion)
      throws IllegalStateException, RepositoryException
   {
      // TODO use interface not JDBC
      JDBCStorageConnection conn = (JDBCStorageConnection)dataContainer.openConnection();
      try
      {
         return conn.getValue(propertyId, orderNumb, persistedVersion);
      }
      finally
      {
         conn.close();
      }
   }
View Full Code Here

            .getProperty("jcr:uuid").getString()));

      WorkspaceStorageConnection conn = dataContainer.openConnection();
      if (conn instanceof JDBCStorageConnection)
      {
         JDBCStorageConnection jdbcConn = (JDBCStorageConnection)conn;

         conn.update(bugData);
         jdbcConn.getJdbcConnection().commit();

         NodeData parent =
            (NodeData)session.getTransientNodesManager().getTransactManager()
               .getItemData(jcrUuid.getParentIdentifier());
         QPathEntry[] qentry = bugData.getQPath().getEntries();
         PropertyData persistedBugData =
            (PropertyData)conn.getItemData(parent, qentry[qentry.length - 1], ItemType.PROPERTY);
         log.info("node_V node BUG uuid: " + node_V.getUUID() + ", jcr:uuid: "
            + new String(persistedBugData.getValues().get(0).getAsByteArray()));

         // =================== remove version record ===================
         Statement smnt = jdbcConn.getJdbcConnection().createStatement();
         log.info("Update container version records: "
            + smnt.executeUpdate("update JCR_" + (isDefaultWsMultiDb ? "M" : "S") + "CONTAINER set VERSION='1.0'"));
         jdbcConn.getJdbcConnection().commit();

         conn.commit();
      }
      else
      {
View Full Code Here

    */
   protected ValueData getPropertyValue(String propertyId, int orderNumb, int persistedVersion)
      throws IllegalStateException, RepositoryException
   {
      // TODO use interface not JDBC
      JDBCStorageConnection conn = (JDBCStorageConnection)dataContainer.openConnection();
      try
      {
         return conn.getValue(propertyId, orderNumb, persistedVersion);
      }
      finally
      {
         conn.close();
      }
   }
View Full Code Here

TOP

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

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.