exo-jcr SVN: r1515 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-01-20 11:25:23 -0500 (Wed, 20 Jan 2010)
New Revision: 1515
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestBLOBValue.java
Log:
EXOJCR-404 test for large set of blobs
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestBLOBValue.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestBLOBValue.java 2010-01-20 16:08:29 UTC (rev 1514)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestBLOBValue.java 2010-01-20 16:25:23 UTC (rev 1515)
@@ -5,21 +5,54 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
+import java.util.Calendar;
+import javax.jcr.ItemExistsException;
import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.PathNotFoundException;
import javax.jcr.Property;
+import javax.jcr.RepositoryException;
import javax.jcr.Session;
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+import javax.jcr.version.VersionException;
public class TestBLOBValue extends JcrAPIBaseTest
{
private static final String TEST_ROOT_NAME = "TestBLOBValue";
-
- private static final int FILE_SIZE_KB = 1024;
+ private static final int FILE_SIZE_KB = 10 * 1024;
+
+ private static final int FILES_COUNT = 1024;
+
+ private static final String FILE_PATH = "F:/Books/jboss/Manning JBoss in Action Jan 2009.pdf";
+
private static File testFile;
private Node testRoot;
+ private Node addNTFile(String fileName, File blob) throws Exception
+ {
+ Node file = testRoot.addNode(fileName, "nt:file");
+
+ Node contentNode = file.addNode("jcr:content", "nt:resource");
+ // contentNode.setProperty("jcr:encoding", "UTF-8");
+ contentNode.setProperty("jcr:mimeType", "application/octet-stream");
+ InputStream is = new FileInputStream(blob);
+ try
+ {
+ contentNode.setProperty("jcr:data", is);
+ }
+ finally
+ {
+ is.close();
+ }
+ contentNode.setProperty("jcr:lastModified", Calendar.getInstance());
+ return file;
+ }
+
@Override
public void setUp() throws Exception
{
@@ -37,20 +70,38 @@
if (testFile == null)
{
- testFile = createBLOBTempFile(FILE_SIZE_KB); // 1MB
+ testFile = createBLOBTempFile(FILE_SIZE_KB);
+ //testFile = new File(FILE_PATH);
}
}
@Override
protected void tearDown() throws Exception
{
- testRoot.remove();
- root.save();
- super.tearDown();
+ if (testRoot.hasProperty("blob"))
+ {
+ testRoot.getProperty("blob").remove();
+ testRoot.save();
+ }
+
+ if (testRoot.hasNodes())
+ {
+ for (NodeIterator children = testRoot.getNodes(); children.hasNext();)
+ {
+ children.nextNode().remove();
+ }
+
+ testRoot.save();
+ }
+
+ //testRoot.remove();
+ //root.save();
+
+ //super.tearDown();
}
- public void testAddProperty() throws Exception
+ public void _testAddProperty() throws Exception
{
// write
Property text = testRoot.setProperty("text", "string property");
@@ -66,33 +117,79 @@
Node troot = user1.getRootNode().getNode(TEST_ROOT_NAME);
Property tblob = troot.getProperty("blob");
InputStream blobStream = tblob.getStream();
-
+
byte[] buff = new byte[1024];
int r = 0;
int size = 0;
- while ((r = blobStream.read(buff))>=0) {
+ while ((r = blobStream.read(buff)) >= 0)
+ {
size += r;
}
-
- assertEquals(FILE_SIZE_KB * 1024, size);
+
+ assertEquals(testFile.length(), size);
}
-
- public void testReadProperty() throws Exception
+
+ public void _testReadProperty() throws Exception
{
// read
Property blob = testRoot.getProperty("blob");
InputStream blobStream = blob.getStream();
-
+
byte[] buff = new byte[1024];
int r = 0;
int size = 0;
- while ((r = blobStream.read(buff))>=0) {
+ while ((r = blobStream.read(buff)) >= 0)
+ {
size += r;
}
-
- assertEquals(FILE_SIZE_KB * 1024, size);
+
+ assertEquals(testFile.length(), size);
}
+ public void testAddNTFiles() throws Exception
+ {
+ // write series of FILES_COUNT adding to each next 1K bytes
+ // do it in one save
+ int size = FILE_SIZE_KB;
+ for (int i = 0; i < FILES_COUNT; i++)
+ {
+ File blob = createBLOBTempFile(size);
+ addNTFile("node" + i, blob);
+
+ size += 1;
+ }
+
+ testRoot.save();
+
+ // it's ready for read
+ }
+
+ public void testReadNTFiles() throws Exception
+ {
+ // read series of FILES_COUNT were added each with size + 1K bytes
+ int size = FILE_SIZE_KB;
+ for (int i = 0; i < FILES_COUNT; i++)
+ {
+ Node file = testRoot.getNode("file" + i);
+
+ Property blob = file.getProperty("jcr:content/jcr:data");
+ InputStream blobStream = blob.getStream();
+
+ byte[] buff = new byte[1024];
+ int r = 0;
+ int bsize = 0;
+ while ((r = blobStream.read(buff)) >= 0)
+ {
+ bsize += r;
+ }
+
+ assertEquals(size * 1024, bsize);
+
+ // calc next
+ size += 1;
+ }
+ }
+
public void testUpdateProperty() throws Exception
{
16 years, 3 months
exo-jcr SVN: r1514 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2010-01-20 11:08:29 -0500 (Wed, 20 Jan 2010)
New Revision: 1514
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
Log:
EXOJCR-423 : run recover only if modeHandler.getMode() == IndexerIoMode.READ_WRITE
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2010-01-20 15:55:01 UTC (rev 1513)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2010-01-20 16:08:29 UTC (rev 1514)
@@ -155,7 +155,7 @@
* Default is (-1) that means no maximal timeout set
*/
public static final int DEFAULT_MAX_VOLATILE_TIME = -1;
-
+
/**
* The default value for {@link #termInfosIndexDivisor}.
*/
@@ -205,7 +205,7 @@
* be flush to FS not later then in maxVolatileTime seconds.
*/
private int maxVolatileTime = DEFAULT_MAX_VOLATILE_TIME;
-
+
/**
* volatileIdleTime config parameter.
*/
@@ -487,8 +487,12 @@
indexDirectory = new File(path);
if (!indexDirectory.exists())
+ {
if (!indexDirectory.mkdirs())
+ {
throw new RepositoryException("fail to create index dir " + path);
+ }
+ }
}
else
{
@@ -587,7 +591,10 @@
File file = new File(indexDirectory, ERROR_LOG);
errorLog = new ErrorLog(file, errorLogfileSize);
// reprocess any notfinished notifies;
- recoverErrorLog(errorLog);
+ if (modeHandler.getMode() == IndexerIoMode.READ_WRITE)
+ {
+ recoverErrorLog(errorLog);
+ }
}
@@ -1653,9 +1660,13 @@
String uuid = doc.get(FieldNames.UUID);
ItemData itd = ism.getItemData(uuid);
if (itd == null)
+ {
continue;
+ }
if (!itd.isNode())
+ {
throw new RepositoryException("Item with id:" + uuid + " is not a node");
+ }
map.put(uuid, (NodeData)itd);
found++;
}
@@ -2635,8 +2646,10 @@
return (NodeData)item; // return node here
}
else
+ {
log.warn("Node expected but property found with id " + id + ". Skipping "
+ item.getQPath().getAsString());
+ }
}
else
{
16 years, 3 months
exo-jcr SVN: r1513 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-01-20 10:55:01 -0500 (Wed, 20 Jan 2010)
New Revision: 1513
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
Log:
EXOJCR-404 fix logic in fixPropertyValue
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2010-01-20 15:48:23 UTC (rev 1512)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2010-01-20 15:55:01 UTC (rev 1513)
@@ -734,7 +734,7 @@
+ prop.getPersistedVersion());
}
- vals.set(i, vd);
+ vals.set(i, svd);
}
}
}
16 years, 3 months
exo-jcr SVN: r1512 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-01-20 10:48:23 -0500 (Wed, 20 Jan 2010)
New Revision: 1512
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
Log:
EXOJCR-404 format
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2010-01-20 15:37:35 UTC (rev 1511)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2010-01-20 15:48:23 UTC (rev 1512)
@@ -811,7 +811,7 @@
{
valueRecord.close();
}
-
+
return null;
}
catch (SQLException e)
@@ -1938,7 +1938,9 @@
}
if (buffer == null)
+ {
return new CleanableFilePersistedValueData(orderNumber, swapFile, swapCleaner);
+ }
return new ByteArrayPersistedValueData(orderNumber, buffer);
}
16 years, 3 months
exo-jcr SVN: r1511 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-01-20 10:37:35 -0500 (Wed, 20 Jan 2010)
New Revision: 1511
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
Log:
EXOJCR-404 cleaunp
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2010-01-20 15:34:48 UTC (rev 1510)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2010-01-20 15:37:35 UTC (rev 1511)
@@ -796,13 +796,13 @@
{
try
{
- final String cid = getInternalId(propertyId);
- final ResultSet valueRecord = findValueByPropertyIdOrderNumber(cid, orderNumb);
+ String cid = getInternalId(propertyId);
+ ResultSet valueRecord = findValueByPropertyIdOrderNumber(cid, orderNumb);
try
{
if (valueRecord.next())
{
- final String storageId = valueRecord.getString(COLUMN_VSTORAGE_DESC);
+ String storageId = valueRecord.getString(COLUMN_VSTORAGE_DESC);
return valueRecord.wasNull() ? readValueData(cid, orderNumb, persistedVersion, valueRecord
.getBinaryStream(COLUMN_VDATA)) : readValueData(propertyId, orderNumb, storageId);
}
16 years, 3 months
exo-jcr SVN: r1510 - in jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl: storage/jdbc/db and 1 other directories.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-01-20 10:34:48 -0500 (Wed, 20 Jan 2010)
New Revision: 1510
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
Log:
EXOJCR-404 fix of sql query for Value data read; fixPropertyValue apllied for all Property reads
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2010-01-20 15:34:06 UTC (rev 1509)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2010-01-20 15:34:48 UTC (rev 1510)
@@ -252,34 +252,6 @@
}
}
- @Deprecated
- protected abstract class StorageTxIsolatedOperation extends TxIsolatedOperation
- {
- StorageTxIsolatedOperation()
- {
- super(transactionManager);
- }
-
- protected void beginTx() throws NotSupportedException, SystemException
- {
- super.beginTx(); // start new global tx
- cache.beginTransaction(); // TODO keep it into the cache impl
- }
-
- protected void commitTx() throws SecurityException, IllegalStateException, RollbackException,
- HeuristicMixedException, HeuristicRollbackException, SystemException
- {
- cache.commitTransaction();
- super.commitTx(); // commit global tx
- }
-
- protected void rollbackTx() throws NotSupportedException, SystemException
- {
- cache.rollbackTransaction();
- super.rollbackTx(); // rollback global tx
- }
- }
-
protected class SaveInTransaction extends TxIsolatedOperation
{
final ItemStateChangesLog changes;
@@ -406,17 +378,11 @@
*/
public List<PropertyData> getChildPropertiesData(NodeData nodeData) throws RepositoryException
{
-
List<PropertyData> childs = getChildPropertiesData(nodeData, false);
- // for (int i = 0; i < childs.size(); i++)
- // {
- // PropertyData data = childs.get(i);
- // if (data.getValues() == null)
- // {
- // // refill the property data if values invalid (null)
- // childs.set(i, fillPropertyValue(data));
- // }
- // }
+ for (PropertyData prop: childs)
+ {
+ fixPropertyValues(prop);
+ }
return childs;
}
@@ -437,33 +403,7 @@
}
else if (!data.isNode())
{
- PropertyData prop = (PropertyData)data;
- List<ValueData> vals = prop.getValues();
- for (int i = 0; i < vals.size(); i++)
- {
- ValueData vd = vals.get(i);
- if (!vd.isByteArray())
- {
- // check if file is correct
- FilePersistedValueData fpvd = (FilePersistedValueData)vd;
- if (fpvd.getFile() == null)
- {
- // need read from storage
- ValueData svd =
- getPropertyValue(prop.getIdentifier(), vd.getOrderNumber(), prop.getPersistedVersion());
-
- if (svd == null)
- {
- // error, value not found
- throw new RepositoryException("Value cannot be found in storage for cached Property "
- + prop.getQPath().getAsString() + ", orderNumb:" + vd.getOrderNumber() + ", pversion:"
- + prop.getPersistedVersion());
- }
-
- vals.set(i, vd);
- }
- }
- }
+ fixPropertyValues((PropertyData)data);
}
return data;
@@ -482,11 +422,10 @@
{
return getPersistedItemData(identifier);
}
- // else if (!data.isNode() && ((PropertyData)data).getValues() == null)
- // {
- // // refill the property data if values invalid (null)
- // data = fillPropertyValue((PropertyData)data);
- // }
+ else if (!data.isNode())
+ {
+ fixPropertyValues((PropertyData)data);
+ }
return data;
}
@@ -767,6 +706,41 @@
}
/**
+ * Fix Property BLOB Values if someone has null file (swap actually) by reading the content from the storage (VS or JDBC no matter).
+ *
+ * @param prop PropertyData
+ * @throws RepositoryException
+ */
+ protected void fixPropertyValues(PropertyData prop) throws RepositoryException
+ {
+ final List<ValueData> vals = prop.getValues();
+ for (int i = 0; i < vals.size(); i++)
+ {
+ ValueData vd = vals.get(i);
+ if (!vd.isByteArray())
+ {
+ // check if file is correct
+ FilePersistedValueData fpvd = (FilePersistedValueData)vd;
+ if (fpvd.getFile() == null)
+ {
+ // need read from storage
+ ValueData svd = getPropertyValue(prop.getIdentifier(), vd.getOrderNumber(), prop.getPersistedVersion());
+
+ if (svd == null)
+ {
+ // error, value not found
+ throw new RepositoryException("Value cannot be found in storage for cached Property "
+ + prop.getQPath().getAsString() + ", orderNumb:" + vd.getOrderNumber() + ", pversion:"
+ + prop.getPersistedVersion());
+ }
+
+ vals.set(i, vd);
+ }
+ }
+ }
+ }
+
+ /**
* Fill Property Value from persistent storage.
*
* @param prop PropertyData, original Property data
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2010-01-20 15:34:06 UTC (rev 1509)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2010-01-20 15:34:48 UTC (rev 1510)
@@ -183,7 +183,7 @@
FIND_VALUES_VSTORAGE_DESC_BY_PROPERTYID = "select distinct STORAGE_DESC from JCR_MVALUE where PROPERTY_ID=?";
- FIND_VALUE_BY_PROPERTYID_OREDERNUMB = "select DATA from JCR_MVALUE where PROPERTY_ID=? and ORDER_NUM=?";
+ FIND_VALUE_BY_PROPERTYID_OREDERNUMB = "select DATA, STORAGE_DESC from JCR_MVALUE where PROPERTY_ID=? and ORDER_NUM=?";
FIND_NODES_BY_PARENTID = "select * from JCR_MITEM" + " where I_CLASS=1 and PARENT_ID=?" + " order by N_ORDER_NUM";
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2010-01-20 15:34:06 UTC (rev 1509)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2010-01-20 15:34:48 UTC (rev 1510)
@@ -190,7 +190,7 @@
FIND_VALUES_VSTORAGE_DESC_BY_PROPERTYID = "select distinct STORAGE_DESC from JCR_SVALUE where PROPERTY_ID=?";
- FIND_VALUE_BY_PROPERTYID_OREDERNUMB = "select DATA from JCR_SVALUE where PROPERTY_ID=? and ORDER_NUM=?";
+ FIND_VALUE_BY_PROPERTYID_OREDERNUMB = "select DATA, STORAGE_DESC from JCR_SVALUE where PROPERTY_ID=? and ORDER_NUM=?";
FIND_NODES_BY_PARENTID =
"select * from JCR_SITEM" + " where I_CLASS=1 and CONTAINER_NAME=? and PARENT_ID=?" + " order by N_ORDER_NUM";
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2010-01-20 15:34:06 UTC (rev 1509)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2010-01-20 15:34:48 UTC (rev 1510)
@@ -198,7 +198,7 @@
FIND_VALUES_VSTORAGE_DESC_BY_PROPERTYID = "select distinct STORAGE_DESC from JCR_MVALUE where PROPERTY_ID=?";
- FIND_VALUE_BY_PROPERTYID_OREDERNUMB = "select DATA from JCR_MVALUE where PROPERTY_ID=? and ORDER_NUM=?";
+ FIND_VALUE_BY_PROPERTYID_OREDERNUMB = "select DATA, STORAGE_DESC from JCR_MVALUE where PROPERTY_ID=? and ORDER_NUM=?";
FIND_NODES_BY_PARENTID = "select * from JCR_MITEM" + " where I_CLASS=1 and PARENT_ID=?" + " order by N_ORDER_NUM";
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2010-01-20 15:34:06 UTC (rev 1509)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2010-01-20 15:34:48 UTC (rev 1510)
@@ -205,7 +205,7 @@
FIND_VALUES_VSTORAGE_DESC_BY_PROPERTYID = "select distinct STORAGE_DESC from JCR_SVALUE where PROPERTY_ID=?";
- FIND_VALUE_BY_PROPERTYID_OREDERNUMB = "select DATA from JCR_SVALUE where PROPERTY_ID=? and ORDER_NUM=?";
+ FIND_VALUE_BY_PROPERTYID_OREDERNUMB = "select DATA, STORAGE_DESC from JCR_SVALUE where PROPERTY_ID=? and ORDER_NUM=?";
FIND_NODES_BY_PARENTID =
"select * from JCR_SITEM" + " where I_CLASS=1 and CONTAINER_NAME=? and PARENT_ID=?" + " order by N_ORDER_NUM";
16 years, 3 months
exo-jcr SVN: r1509 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2010-01-20 10:34:06 -0500 (Wed, 20 Jan 2010)
New Revision: 1509
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexChangesFilter.java
Log:
EXOJCR-423 : log all CacheExceptions
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexChangesFilter.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexChangesFilter.java 2010-01-20 14:49:26 UTC (rev 1508)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexChangesFilter.java 2010-01-20 15:34:06 UTC (rev 1509)
@@ -31,6 +31,7 @@
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.jboss.cache.Cache;
+import org.jboss.cache.CacheException;
import org.jboss.cache.CacheFactory;
import org.jboss.cache.CacheSPI;
import org.jboss.cache.DefaultCacheFactory;
@@ -80,7 +81,7 @@
// initialize IndexerCacheLoader
IndexerCacheLoader indexerCacheLoader = new IndexerCacheLoader();
// inject dependencies
- indexerCacheLoader.init(searchManager, parentSearchManager, handler, parentHandler);
+ indexerCacheLoader.init(searchManager, parentSearchManager, handler, parentHandler);
// set SingltonStoreCacheLoader
SingletonStoreConfig singletonStoreConfig = new SingletonStoreConfig();
singletonStoreConfig.setSingletonStoreClass(IndexerSingletonStoreCacheLoader.class.getName());
@@ -89,7 +90,7 @@
singletonStoreProperties.setProperty("pushStateWhenCoordinator", "false");
singletonStoreProperties.setProperty("pushStateWhenCoordinatorTimeout", "10000");
singletonStoreConfig.setProperties(singletonStoreProperties);
- singletonStoreConfig.setSingletonStoreEnabled(true);
+ singletonStoreConfig.setSingletonStoreEnabled(true);
// create CacheLoaderConfig
IndividualCacheLoaderConfig individualCacheLoaderConfig = new IndividualCacheLoaderConfig();
// set SingletonStoreConfig
@@ -142,7 +143,34 @@
Set<String> parentAddedNodes)
{
String id = IdGenerator.generate();
- cache.put(id, LISTWRAPPER, new ChangesFilterListsWrapper(addedNodes, removedNodes, parentAddedNodes,
- parentRemovedNodes));
+ try
+ {
+ cache.put(id, LISTWRAPPER, new ChangesFilterListsWrapper(addedNodes, removedNodes, parentAddedNodes,
+ parentRemovedNodes));
+ }
+ catch (CacheException e)
+ {
+ logErrorChanges(handler, removedNodes, addedNodes);
+ logErrorChanges(parentHandler, parentRemovedNodes, parentAddedNodes);
+ }
}
+
+ /**
+ * Log errors
+ * @param logHandler
+ * @param removedNodes
+ * @param addedNodes
+ */
+ private void logErrorChanges(QueryHandler logHandler, Set<String> removedNodes, Set<String> addedNodes)
+ {
+ try
+ {
+
+ logHandler.logErrorChanges(addedNodes, removedNodes);
+ }
+ catch (IOException ioe)
+ {
+ log.warn("Exception occure when errorLog writed. Error log is not complete. " + ioe, ioe);
+ }
+ }
}
16 years, 3 months
exo-jcr SVN: r1508 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-01-20 09:49:26 -0500 (Wed, 20 Jan 2010)
New Revision: 1508
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TxIsolatedOperation.java
Log:
EXOJCR-410 don't throw RepositoryException on tx.commit() as it's only a cache commit and cache cannot fails the save
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TxIsolatedOperation.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TxIsolatedOperation.java 2010-01-20 14:09:11 UTC (rev 1507)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TxIsolatedOperation.java 2010-01-20 14:49:26 UTC (rev 1508)
@@ -98,40 +98,46 @@
catch (RollbackException e)
{
// Indicate that the transaction has been rolled back rather than committed.
- throw new RepositoryException(e);
+ // TODO throw new RepositoryException(e);
+ LOG.error("Transaction has been rolled back", e);
}
catch (HeuristicRollbackException e)
{
// if all relevant updates have been rolled back on commit
- throw new RepositoryException(e);
+ // TODO throw new RepositoryException(e);
+ LOG.error("Relevant updates have been rolled back", e);
}
catch (HeuristicMixedException e)
{
// if some relevant updates have been committed and others have been rolled back on commit
// TODO partial commit - got inconsistency. rollback not possible?
// doRollback();
- throw new RepositoryException(e);
+ // TODO throw new RepositoryException(e);
+ LOG.error("Some relevant updates have been committed and others have been rolled back", e);
}
catch (IllegalStateException e)
{
// if thread is not associated with a transaction
// TODO can we do rollback if not in the tx thread?
// doRollback();
- throw new RepositoryException(e);
+ // TODO throw new RepositoryException(e);
+ LOG.error("Commit impossible, thread is not associated with a transaction", e);
}
catch (SecurityException e)
{
// if thread is not allowed to commit the transaction
// TODO can we do the rollback, will it have a rights?
// doRollback();
- throw new RepositoryException(e);
+ // TODO throw new RepositoryException(e);
+ LOG.error("Commit impossible, thread is not allowed to commit the transaction", e);
}
catch (SystemException e)
{
// if XA unexpected error
// TODO rollback not possible?
// doRollback();
- throw new RepositoryException(e);
+ // TODO throw new RepositoryException(e);
+ LOG.error("Commit impossible dur to unexpected XA error", e);
}
finally
{
16 years, 3 months
exo-jcr SVN: r1506 - jcr/branches/1.12.0-JBCCACHE.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-01-20 08:50:56 -0500 (Wed, 20 Jan 2010)
New Revision: 1506
Modified:
jcr/branches/1.12.0-JBCCACHE/pom.xml
Log:
EXOJCR-388 dependencies versions updated according to EAP
Modified: jcr/branches/1.12.0-JBCCACHE/pom.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/pom.xml 2010-01-20 13:30:57 UTC (rev 1505)
+++ jcr/branches/1.12.0-JBCCACHE/pom.xml 2010-01-20 13:50:56 UTC (rev 1506)
@@ -237,7 +237,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
- <version>1.5.6</version>
+ <version>1.5.8</version>
</dependency>
<dependency>
<groupId>stax</groupId>
@@ -323,7 +323,7 @@
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
- <version>3.1</version>
+ <version>3.2</version>
</dependency>
<dependency>
<groupId>org.apache.ws.commons</groupId>
@@ -338,7 +338,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
- <version>1.5.6</version>
+ <version>1.5.8</version>
</dependency>
<dependency>
<groupId>hsqldb</groupId>
16 years, 3 months