mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Fix for AR-1432: Patches for FK indexes
Fix for AR-1433: Upgrade failures on PostgreSQL Partial fix for AR-160: Concurrency fix for version counter Partial fix for AR-1483: Synchronization issues This is an overhaul of the current state of the upgrade scripts. All redundant scripts have been ripped out and replaced with fresh 2.1 scripts. Indexes for FK relationships have been put in place where required. Several edge cases have been dealt with including columns being added to two indexes, Sybase not allowing column additions for NOT NULL columns of certain types, etc. These changes have been tested for 1.4.0 -> 2.0 -> 2.1 on MySQL Oracle Sybase PostgreSQL Found a bug in the VersionCounter Hibernate classes where the optimistic version support was not implemented. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6216 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -14,12 +14,18 @@
|
||||
dynamic-insert="false"
|
||||
select-before-update="false"
|
||||
optimistic-lock="version" >
|
||||
|
||||
<!-- composite PK -->
|
||||
<composite-id name="key" class="org.alfresco.repo.domain.StoreKey">
|
||||
<key-property name="protocol" length="100" />
|
||||
<key-property name="identifier" length="100" />
|
||||
</composite-id>
|
||||
|
||||
<!-- Optimistic locking -->
|
||||
<version column="version" name="version" type="long" />
|
||||
|
||||
<property name="versionCount" column="version_count" type="int" not-null="true" />
|
||||
|
||||
</class>
|
||||
|
||||
</hibernate-mapping>
|
||||
|
@@ -39,8 +39,7 @@ public class VersionCountImpl implements VersionCount, Serializable
|
||||
private static final long serialVersionUID = 6420375860928877809L;
|
||||
|
||||
private StoreKey key;
|
||||
@SuppressWarnings("unused")
|
||||
private long version; // used by Hibernate for concurrency
|
||||
private long version;
|
||||
private int versionCount;
|
||||
|
||||
public VersionCountImpl()
|
||||
@@ -89,11 +88,25 @@ public class VersionCountImpl implements VersionCount, Serializable
|
||||
return key;
|
||||
}
|
||||
|
||||
public synchronized void setKey(StoreKey key)
|
||||
public void setKey(StoreKey key)
|
||||
{
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
|
||||
/**
|
||||
* For Hibernate use
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
private void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
/**
|
||||
* For Hibernate use
|
||||
*/
|
||||
|
Reference in New Issue
Block a user