Author: tolusha
Date: 2009-11-11 03:20:33 -0500 (Wed, 11 Nov 2009)
New Revision: 554
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 sessionId support
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
08:05:59 UTC (rev 553)
+++
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-11-11
08:20:33 UTC (rev 554)
@@ -166,9 +166,9 @@
{
if (systemConnection == null)
{
- conn =
+ conn = systemConnection == null
// we need system connection but it's not exist
- systemConnection = (systemDataContainer != dataContainer
+ ? systemConnection = (systemDataContainer != dataContainer
// if it's different container instances
? systemDataContainer.equals(dataContainer) &&
thisConnection != null
// but container confugrations are same and non-system
connnection open
@@ -181,9 +181,9 @@
// and non-system connection doens't exist - open it
? thisConnection = dataContainer.openConnection()
// if already open - use it
- : thisConnection);
- if (!systemConnection.equals(thisConnection))
- systemConnection.addSessionInfo(currChangesLog.getSessionId(),
"userId");
+ : thisConnection)
+ // system connection opened - use it
+ : systemConnection;
}
else
{
@@ -193,32 +193,24 @@
}
else
{
- if (thisConnection == null)
- {
- conn =
- // we need this conatiner conection
- thisConnection = (systemDataContainer != dataContainer
- // if it's different container instances
- ? dataContainer.equals(systemDataContainer) &&
systemConnection != null
- // but container confugrations are same and system connnection
open
- // reuse system connection as this
- ? dataContainer.reuseConnection(systemConnection)
- // or open one new
- : dataContainer.openConnection()
- // else if it's same container instances (system and
this)
- : systemConnection == null
- // and system connection doens't exist - open it
- ? systemConnection = dataContainer.openConnection()
- // if already open - use it
- : systemConnection);
- if (!thisConnection.equals(systemConnection))
- thisConnection.addSessionInfo(currChangesLog.getSessionId(),
"userId");
- }
- else
- {
+ conn = thisConnection == null
+ // we need this conatiner conection
+ ? thisConnection = (systemDataContainer != dataContainer
+ // if it's different container instances
+ ? dataContainer.equals(systemDataContainer) &&
systemConnection != null
+ // but container confugrations are same and system connnection
open
+ // reuse system connection as this
+ ? dataContainer.reuseConnection(systemConnection)
+ // or open one new
+ : dataContainer.openConnection()
+ // else if it's same container instances (system and this)
+ : systemConnection == null
+ // and system connection doens't exist - open it
+ ? systemConnection = dataContainer.openConnection()
+ // if already open - use it
+ : systemConnection)
// this connection opened - use it
- conn = thisConnection;
- }
+ : thisConnection;
}
data.increasePersistedVersion();
@@ -244,10 +236,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();