Author: tolusha
Date: 2009-11-11 04:34:47 -0500 (Wed, 11 Nov 2009)
New Revision: 557
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
Log:
EXOJCR-201: refactoring
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-11-11
09:12:32 UTC (rev 556)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-11-11
09:34:47 UTC (rev 557)
@@ -25,7 +25,6 @@
import org.exoplatform.services.jcr.dataflow.PersistentDataManager;
import org.exoplatform.services.jcr.dataflow.PlainChangesLog;
import org.exoplatform.services.jcr.dataflow.ReadOnlyThroughChanges;
-import org.exoplatform.services.jcr.dataflow.TransactionChangesLog;
import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceListener;
import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceListenerFilter;
import
org.exoplatform.services.jcr.dataflow.persistent.MandatoryItemsPersistenceListener;
@@ -150,6 +149,9 @@
{
for (PlainChangesLog currChangesLog : chengesLogList)
{
+ boolean systemConnSessionInfoAdded = false;
+ boolean thisConnSessionInfoAdded = false;
+
for (Iterator<ItemState> iter =
currChangesLog.getAllStates().iterator(); iter.hasNext();)
{
ItemState itemState = iter.next();
@@ -169,7 +171,7 @@
? systemConnection = (systemDataContainer != dataContainer
// if it's different container instances
? systemDataContainer.equals(dataContainer) &&
thisConnection != null
- // but container confugrations are same and non-system
connnection open
+ // but container configurations are same and non-system
connection open
// reuse this connection as system
? systemDataContainer.reuseConnection(thisConnection)
// or open one new system
@@ -182,15 +184,22 @@
: thisConnection)
// system connection opened - use it
: systemConnection;
+
+ if (!systemConnSessionInfoAdded)
+ {
+ if (!systemConnection.equals(thisConnection))
+ systemConnection.addSessionInfo(currChangesLog.getSessionId(),
"");
+ systemConnSessionInfoAdded = true;
+ }
}
else
{
conn = thisConnection == null
- // we need this conatiner conection
+ // we need this container connection
? thisConnection = (systemDataContainer != dataContainer
// if it's different container instances
? dataContainer.equals(systemDataContainer) &&
systemConnection != null
- // but container confugrations are same and system connnection
open
+ // but container configurations are same and system connection
open
// reuse system connection as this
? dataContainer.reuseConnection(systemConnection)
// or open one new
@@ -203,6 +212,13 @@
: systemConnection)
// this connection opened - use it
: thisConnection;
+
+ if (!thisConnSessionInfoAdded)
+ {
+ if (!thisConnection.equals(systemConnection))
+ thisConnection.addSessionInfo(currChangesLog.getSessionId(),
"");
+ thisConnSessionInfoAdded = true;
+ }
}
data.increasePersistedVersion();
@@ -228,10 +244,10 @@
LOG.debug(ItemState.nameFromValue(itemState.getState()) + " "
+ (System.currentTimeMillis() - start)
+ "ms, " + data.getQPath().getAsString());
}
- // if (thisConnection != null)
- // thisConnection.removeSessionInfo();
- // if (systemConnection != null &&
!systemConnection.equals(thisConnection))
- // systemConnection.removeSessionInfo();
+ if (thisConnection != null)
+ thisConnection.removeSessionInfo();
+ if (systemConnection != null &&
!systemConnection.equals(thisConnection))
+ systemConnection.removeSessionInfo();
}
if (thisConnection != null)
thisConnection.commit();
Show replies by date