mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Merged V2.2 to HEAD
8041: Merged V2.1 to V2.2 7736: Fix for broken "make versionable" action after webdav fixes 7755: Fix AR-1962: File is not truncated when opened for overwrite when using the older CIFS open file request 7971: Fix for AR-1964 (IE7 character encoding) 7973: Fixes transient submit failures when submitting deleted directories with no ancestors 7989: ACT-858: AVM Issuer 7994: WebDav document url now available in Template/Script APIs as per AR-1917 8002: AR-1978: Added support for SPNEGO to the CIFS passthru authenticator git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8462 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -87,9 +87,9 @@ public class Issuer
|
||||
public Object execute()
|
||||
{
|
||||
IssuerID issuerID = fIDDAO.get(fName);
|
||||
if (issuerID == null)
|
||||
Long id = fIssuerDAO.getIssuerValue(fName);
|
||||
if (issuerID == null || id == null || id >= issuerID.getNext())
|
||||
{
|
||||
Long id = fIssuerDAO.getIssuerValue(fName);
|
||||
if (id == null)
|
||||
{
|
||||
id = 0L;
|
||||
@@ -98,8 +98,15 @@ public class Issuer
|
||||
{
|
||||
id = id + 1L;
|
||||
}
|
||||
issuerID = new IssuerIDImpl(fName, id);
|
||||
fIDDAO.save(issuerID);
|
||||
if (issuerID == null)
|
||||
{
|
||||
issuerID = new IssuerIDImpl(fName, id);
|
||||
fIDDAO.save(issuerID);
|
||||
}
|
||||
else
|
||||
{
|
||||
issuerID.setNext(id);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -123,11 +130,46 @@ public class Issuer
|
||||
{
|
||||
if (fNext >= fLast)
|
||||
{
|
||||
IssuerID isID = fIDDAO.get(fName);
|
||||
fNext = isID.getNext();
|
||||
fLast = fNext + BLOCK_SIZE;
|
||||
isID.setNext(fLast);
|
||||
BlockGetter getter = new BlockGetter();
|
||||
Thread thread = new Thread(getter);
|
||||
thread.start();
|
||||
try
|
||||
{
|
||||
thread.join();
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
fNext = getter.fNext;
|
||||
fLast = getter.fLast;
|
||||
}
|
||||
return fNext++;
|
||||
}
|
||||
|
||||
private class BlockGetter implements Runnable
|
||||
{
|
||||
public long fNext;
|
||||
|
||||
public long fLast;
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
fTxnService.getRetryingTransactionHelper().doInTransaction(
|
||||
new RetryingTransactionCallback<Object>()
|
||||
{
|
||||
public Object execute()
|
||||
{
|
||||
IssuerID isID = fIDDAO.get(fName);
|
||||
fNext = isID.getNext();
|
||||
fLast = fNext + BLOCK_SIZE;
|
||||
isID.setNext(fLast);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user