Author: paristote
Date: 2011-05-24 06:07:21 -0400 (Tue, 24 May 2011)
New Revision: 4421
Added:
jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1618/readme.txt
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/jdbc-data-container-config.xml
jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/data-container.xml
Log:
JCR-1618
What is the problem to fix?
This issue is only reproduced with Mysql engine type InnoDB(not reproduced with MySQL
MyIsam)
when we try to create a new nodetype with same name sibling we get an exception.
How is the problem fixed?
Check-sns-new-connection is set to false by default
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
===================================================================
---
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-05-24
09:43:47 UTC (rev 4420)
+++
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-05-24
10:07:21 UTC (rev 4421)
@@ -370,7 +370,7 @@
}
catch (RepositoryConfigurationException e)
{
- this.checkSNSNewConnection =
DBConstants.DB_DIALECT_SYBASE.equals(this.dbDialect) ? false : true;
+ this.checkSNSNewConnection = false;
}
// ------------- Values swap config ------------------
@@ -836,6 +836,22 @@
*/
public void start()
{
+ // if isolation level lesser then TRANSACTION_READ_COMMITTED, print a warning
+ try
+ {
+ if (getConnectionFactory().getJdbcConnection().getTransactionIsolation() <
Connection.TRANSACTION_READ_COMMITTED)
+ {
+ LOG.warn("Wrong default isolation level, please set the default
isolation level to READ_COMMITTED or higher. Other default isolation levels are not
supported");
+ }
+ }
+ catch (SQLException e)
+ {
+ LOG.error("Error checking isolation level configuration.", e);
+ }
+ catch (RepositoryException e)
+ {
+ LOG.error("Error checking isolation level configuration.", e);
+ }
}
/**
Modified:
jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/jdbc-data-container-config.xml
===================================================================
---
jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/jdbc-data-container-config.xml 2011-05-24
09:43:47 UTC (rev 4420)
+++
jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/jdbc-data-container-config.xml 2011-05-24
10:07:21 UTC (rev 4421)
@@ -56,6 +56,13 @@
</listitem>
</itemizedlist></para>
+ <note>
+ <para>Please note, that JCR requires at least READ_COMMITED isolation
+ level and other RDBMS configurations can cause some side-effects and
+ issues. So, please, make sure proper isolation level is configured on
+ database server side.</para>
+ </note>
+
<para>Each database software supports ANSI SQL standards but also has its
own specifics. So, each database has its own configuration in eXo JCR as a
database dialect parameter. If you need a more detailed configuration of
Modified:
jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/data-container.xml
===================================================================
---
jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/data-container.xml 2011-05-24
09:43:47 UTC (rev 4420)
+++
jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/data-container.xml 2011-05-24
10:07:21 UTC (rev 4421)
@@ -96,18 +96,6 @@
<programlisting>boolean isCheckSNSNewConnection();
</programlisting>
- <important>
- <title>New connection for SNS</title>
-
- <para>It is neccessary to check the name of nodes when they have the
- same names. Usually, new Workspace Storage Connection is used for this
- purpose. The improvement came from JDBC Workspace Data Container,
- which shows a better performance on Oracle RDBMS when using new
- connection for checking SNS existence. But later, this causes to
- deadlocks on Sybase RDBMS, so this feature is made as an optional and
- configurable one.</para>
- </important>
-
<para>Container initialization is only based on a configuration. After
the container has been created, it's not possible to change parameters.
Configuration consists of implementation class and set of properties and
Added: jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1618/readme.txt
===================================================================
--- jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1618/readme.txt (rev
0)
+++ jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1618/readme.txt 2011-05-24 10:07:21 UTC (rev
4421)
@@ -0,0 +1,106 @@
+Summary
+
+ Status: javax.jcr.InvalidItemStateException: Node can't be saved No same-name
sibling exists with index 2
+ CCP Issue: CCP-928, Product Jira Issue: JCR-1618.
+ Complexity: Low
+
+The Proposal
+Problem description
+
+What is the problem to fix?
+This issue is only reproduced with Mysql engine type InnoDB(not reproduced with MySQL
MyIsam)
+
+when we try to create a new nodetype with same name sibling we get this exception :
+12:54:42,125 ERROR [STDERR] javax.jcr.InvalidItemStateException: Node can't be saved
[]:1[]test2000:3. No same-name sibling exists with index 2.
+12:54:42,125 ERROR [STDERR] at
org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePersistentDataManager.checkPersistedSNS(WorkspacePersistentDataManager.java:586)
+12:54:42,125 ERROR [STDERR] at
org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePersistentDataManager.checkSameNameSibling(WorkspacePersistentDataManager.java:558)
+12:54:42,125 ERROR [STDERR] at
org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePersistentDataManager.doAdd(WorkspacePersistentDataManager.java:655)
+12:54:42,125 ERROR [STDERR] at
org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePersistentDataManager$ChangesLogPersister.save(WorkspacePersistentDataManager.java:387)
+12:54:42,125 ERROR [STDERR] at
org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePersistentDataManager.save(WorkspacePersistentDataManager.java:165)
+12:54:42,125 ERROR [STDERR] at
org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWorkspaceDataManager.access$101(CacheableWorkspaceDataManager.java:54)
+12:54:42,125 ERROR [STDERR] at
org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWorkspaceDataManager$SaveInTransaction.action(CacheableWorkspaceDataManager.java:262)
+12:54:42,125 ERROR [STDERR] at
org.exoplatform.services.jcr.impl.dataflow.persistent.TxIsolatedOperation.txAction(TxIsolatedOperation.java:92)
+12:54:42,125 ERROR [STDERR] at
org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWorkspaceDataManager$SaveInTransaction.txAction(CacheableWorkspaceDataManager.java:268)
+12:54:42,125 ERROR [STDERR] at
org.exoplatform.services.jcr.impl.dataflow.persistent.TxIsolatedOperation.perform(TxIsolatedOperation.java:210)
+12:54:42,125 ERROR [STDERR] at
org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWorkspaceDataManager.save(CacheableWorkspaceDataManager.java:526)
+12:54:42,125 ERROR [STDERR] at
org.exoplatform.services.jcr.impl.dataflow.persistent.ACLInheritanceSupportedWorkspaceDataManager.save(ACLInheritanceSupportedWorkspaceDataManager.java:225)
+12:54:42,125 ERROR [STDERR] at
org.exoplatform.services.jcr.impl.dataflow.persistent.VersionableWorkspaceDataManager.save(VersionableWorkspaceDataManager.java:244)
+12:54:42,125 ERROR [STDERR] at
org.exoplatform.services.jcr.impl.dataflow.session.TransactionableDataManager.save(TransactionableDataManager.java:366)
+12:54:42,125 ERROR [STDERR] at
org.exoplatform.services.jcr.impl.core.SessionDataManager.commit(SessionDataManager.java:1389)
+12:54:42,125 ERROR [STDERR] at
org.exoplatform.services.jcr.impl.core.ItemImpl.save(ItemImpl.java:684)
+12:54:42,125 ERROR [STDERR] at
org.exoplatform.services.jcr.impl.core.SessionImpl.save(SessionImpl.java:935)
+12:54:42,125 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
+12:54:42,125 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
+12:54:42,125 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
+12:54:42,125 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
+
+How to reproduce :
+you can find in attachment a sample usecase you need just to deploy the bsh script under
your jboss home and you will get this exception
+
+we create in this case a node "test" then we save the session and if we try to
create a new node with the same name we get InvalidItemState Exception :
+print("create first Node");
+ sess = getSessionFromExoAPI();
+ print(sess);
+ sess.getRootNode().addNode("test");
+ sess.save();
+ print("create second Node");
+ print("Initializing");
+ sess = getSessionFromExoAPI();
+ print(sess);
+ print("create second Node with the same name");
+ sess.getRootNode().addNode("test");
+ sess.save();
+Fix description
+
+How is the problem fixed?
+
+Check-sns-new-connection is set to false by default
+
+Patch information:
+JCR-1618.patch
+
+Tests to perform
+
+Reproduction test
+
+ No
+
+Tests performed at DevLevel
+
+ functional tests in jcr-core project. Manual testing wih JBoss bundle.
+
+Tests performed at QA/Support Level
+*
+
+Documentation changes
+
+Documentation changes:
+ No
+
+Configuration changes
+
+Configuration changes:
+ No
+
+Will previous configuration continue to work?
+ Yes
+
+Risks and impacts
+
+Can this bug fix have any side effects on current client projects?
+ No
+
+Is there a performance risk/cost?
+ No
+
+Validation (PM/Support/QA)
+
+PM Comment
+* PL review: Patch validated
+
+Support Comment
+* Support review: Patch validated
+
+QA Feedbacks
+*
+